PHP decoct() - Math Functions

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

Explanation

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

Syntax:


decoct(dec_number)

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

Example :


<?php
echo decoct(10) . "n";
echo decoct(15);
?>
Result :

12
17

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

PHP Topics


Ask Questions

Ask Question