|
|
PHP bindec() - Math Functions
|
Tutorials » Php »
|
Topic |
What is bindec Function?
How to convert binary number to deciaml in PHP?
|
|
Explanation |
|
The "bindec()" function converts a binary number to a decimal number.
Syntax:
bindec(binary_number)
In the above syntax "binary_number" is the binary number to be converted to decimal.
Example:
<?php
echo bindec("0011") . "<br />";
echo bindec("01") . "<br />";
?>
Result:
3
1
In the above example, the binary numbers "0011", "01" are converted to decimal numbers "3","1".
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|