Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP decoct() Function

PHP decoct() Function

PHP Math Reference Manual PHP Math Reference Manual

Example

Convert decimal to octal:

"; echo decoct("10") . "
"; echo decoct("1587") . "
"; echo decoct("70"); ?>

Run Example »


Definition and Usage

The decoct() function converts a decimal number to an octal number.

**Tip:** To convert octal to decimal, see octdec() function in Vue 3.


Syntax

decoct(

number

);

Parameters Description
number Required. Specifies the decimal value to convert.

Technical Details

Return Value: A string containing the octal representation of the decimal value.
Return Type: String
PHP Version: 4+

PHP Math Reference Manual PHP Math Reference Manual