PHP octdec()Functions

PHP Math 参考手册PHP Math Reference Manual

Examples

Convert octal to decimal:

<?php
echo octdec("36") . "<br>";
echo octdec("12") . "<br>";
echo octdec("3063") . "<br>";
echo octdec("106");
?>

Run example »

Definition and Usage

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

Tip:To convert a decimal number to an octal number, seedecoct()function.


Syntax

octdec(octal_string);

Parameters Description
octal_string Required. Specifies the octal string to convert.

Technical Details

Return value: octal_stringThe decimal value.
Return type: Float / Integer
PHP Version: 4+


PHP Math 参考手册PHP Math Reference Manual Other Extensions