number bindec(string $binary);
Parameter | DESCRIPTION |
$binary | Required : Binary number as Input string representing number to convert to equivalent decimal number. |
The output is number converted to decimal base system.
Warning
The input $binary must be a string. Using other data types will produce unexpected results.
Example : Binary to Decimal
echo bindec('1101'); // Output 13
echo "<br>";
echo bindec('0101'); // Output 5
echo "<br>";
echo bindec('10110'); // Output is 22
echo "<br>";
echo bindec('101101101'); // Output is 365
echo "<br>";
echo bindec('111011100'); // Output is 476
echo "<br>";
← Subscribe to our YouTube Channel here