PHP octdec() Function
Example
Convert octal to decimal:
<?php
echo octdec("36") . "<br>";
echo octdec("12") . "<br>";
echo octdec("3063") . "<br>";
echo octdec("106");
?>
Try it Yourself »
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 Values
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
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.