The octdec()
function converts an octal number into a decimal number.
PHP octdec() Function has the following format.
number octdec ( string octal_string )
Parameter | Is Required | Description |
---|---|---|
octal_string | Required. | Octal string to convert |
Item | Description |
---|---|
Return Value | The decimal value of octal_string |
Return Type | Float / Integer |
Convert octal to decimal:
<?php
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.