|
|
PHP decoct() - Math Functions
|
Tutorials » Php »
|
Topic |
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".
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|