w3resource

PHP: octdec() function

Description

The octdec() function is used to convert an octal number to a decimal number.

Version:

(PHP 4 and above)

Syntax:

octdec(num)

Parameter:

Name Description Required /
Optional
Type
num The octal number to convert. Required String

Return value:

The decimal value of the octal string.

Value Type: Float/integer.

Pictorial Presentation

php-math-octdec()

Example:

<?php
echo octdec('26').'<br>';
echo octdec('172').'<br>';
echo octdec('3154').'<br>';
?>

Output :

22
122
1644

View the example in the browser

See also

PHP Function Reference

Previous: mt_srand
Next: pi



Follow us on Facebook and Twitter for latest update.