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

Octdec () PHP Function

By Angela Bradley, About.com

Definition: The Octdec () PHP Function is used to convert an octal number into a decimal. This is similar to the base_convert () PHP function only it works specifically for turning octal numbers into base 10. The opposite function, Decoct (), converts a decimal into an octal number.
Also Known As: convert octal number
Examples:
<?php
echo(octdec(1) . "<br />");
echo(octdec(144) . "<br />");
echo(octdec(6654) . "<br />");
echo(octdec(56052) . "<br />");
?>
This would return the following:
1
100
3500
23594
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. Octdec PHP Function - Convert from an octal number to a decimal

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

All rights reserved.