octdec

int octdec(string oct) 

Converts a number from octal to decimal notation.

Returns:

Decimal equivalent of an octal value

Description:

Converts an octal number represented as a string into its decimal equivalent. If the string is not a valid octal number, an error is returned. The largest octal value that can be converted is 017777777777.

Leading zeros are ignored.

Version:

PHP 3, PHP 4

See also:

base_convert() 
bindec() 
decbin() 
dechex() 
decoct() 
hexdec() 

Example:

Convert an octal number to decimal
$number = '0123456'; 
echo octdec($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.