Convert decimal to octal:
<?phpecho decoct("30") . "<br>";echo decoct("10") . "<br>";echo decoct("1587") . "<br>";echo decoct("70" );?>The decoct() function converts a decimal number to an octal number.
Tip: To convert octal to decimal, check out the octdec() function.
decoct( number );
parameter | describe |
---|---|
number | Required. Specifies the decimal value to be converted. |
Return value: | A string containing an octal number as a decimal value. |
---|---|
Return type: | String |
PHP version: | 4+ |