PHP octdec() - Math Functions

What is octdec Function?
How to convert octal number to decimal in PHP?

Explanation

The "octdec()" function converts a octal number to decimal number.

Syntax:

octdec(oct_number)

In the above syntax, "oct_number" is the octal number to be converted to decimal number.

Example :


<?php
echo octdec(12) . "n";
echo octdec(17);
?>
Result :

10
15

In the above example, the octal numbers "12", "17" are converted to decimal numbers "10", "15".

PHP Topics


Ask Questions

Ask Question