1. Home
  2. Computing & Technology
  3. PHP / MySQL

Decoct () PHP Function

By Angela Bradley, About.com

Definition: The Decoct () PHP Function is used to convert a decimal number into an octal number. If you want to change it back again you can use the Base_convert () PHP function or the Octdec () Function. The highest number that can be converted is 4294967295 in decimal which becomes 37777777777 in octal.
Also Known As: Octal Number
Examples:
<?php
echo(decoct(1) . "<br />");
echo(decoct(100) . "<br />");
echo(decoct(3500) . "<br />");
echo(decoct(23594) . "<br />");
?>
This will return:
1
144
6654
56052
Explore PHP / MySQL
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. PHP Functions
  5. Decoct PHP Function - Convert a decimal into an octal number

©2009 About.com, a part of The New York Times Company.

All rights reserved.