Home >Backend Development >PHP Tutorial >PHP base conversion

PHP base conversion

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-29 09:04:521154browse

Binary bin
decimal dec
Octal oct
The result of converting hexadecimal hex

decimal to other decimals is a string. Converting other bases to decimal requires that the given data be in the form of a string

<code><span>//十进制转二进制</span><span>$d</span> = decbin(<span>8</span>);
<span>//十进制转八进制</span><span>$o</span> = decoct(<span>8</span>);
<span>//十进制转十六进制</span><span>$h</span> = dechex(<span>8</span>);
<span>//十六进制转十进制</span><span>$d</span> = hexdex(<span>"8"</span>);</code>
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces the base conversion in PHP, including aspects of it. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn