PHP octdec() Function

Definition

The octdec() function converts an octal number into a decimal number.

Syntax

PHP octdec() Function has the following format.

number octdec ( string octal_string )

Parameter

ParameterIs Required Description
octal_stringRequired. Octal string to convert

Return

Item Description
Return Value The decimal value of octal_string
Return Type Float / Integer

Example

Convert octal to decimal:


<?php// ww  w  .j av  a  2  s . c  om
print octdec("23");
echo octdec("36") . "\n";
echo octdec("12") . "\n";
echo octdec("303") . "\n";
echo octdec("10");
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions