octdec()
ViktoriaSeprenyi1 total contribution
Published Dec 12, 2023
Contribute to Docs
The octdec
() function is a built-in function that calculates the decimal equivalent of an octal number. It accepts the octal number as the only argument.
Syntax
octdec(value);
value
: An octal number given as a parameter to the function in string format. If an invalid character is passed, it is ignored.
Example
The example below uses the octdec()
function to convert an octal number to its decimal value.
<?phpecho octdec("65") . "<br>";echo octdec("3098") . "<br>";?>
This example will give the following output:
5324
Codebyte Example
Run the code below to get a better idea of how the octdec()
function works:
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.