decoct

string decoct(int dec) 

Returns the octal notation for the given decimal argument.

Returns:

Octal number as a string

Description:

Converts the integer given by dec into a string containing its octal equivalent. The largest octal that can be calculated is 017777777777.

Version:

PHP 3, PHP 4

See also:

base_convert() 
bindec() 
decbin() 
dechex() 
hexdec() 
octdec() 

Example:

Get the octal representation of a number
$number = 123456; 
echo "The octal value of $number is ", decoct($number); 

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.