Latest web development tutorials

PHP decoct () function

PHP Math Reference PHP Math Reference

Examples

The Decimal to octal:

<?php
echo decoct("30") . "<br>";
echo decoct("10") . "<br>";
echo decoct("1587") . "<br>";
echo decoct("70");
?>

Running instance »

Definition and Usage

decoct () function to convert a decimal number to octal.

Tip: If you need to convert octal to decimal, see octdec () function.


grammar

decoct( number );

参数 描述
number 必需。规定要转换的十进制值。

technical details

return value: A string containing an octal number decimal value.
Return type: String
PHP version: 4+


PHP Math Reference PHP Math Reference