THE WORLD'S LARGEST WEB DEVELOPER SITE

PHP octdec() Function

❮ PHP Math Reference

Example

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 decimal to octal, look at the decoct() function.


Syntax

octdec(octal_string);

Parameter Description
octal_string Required. Specifies the octal string to convert

Technical Details

Return Value: The decimal value of octal_string
Return Type: Float / Integer
PHP Version: 4+

❮ PHP Math Reference