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



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/php/function-reference/octdec.php