How to use bindec() to convert binary to decimal in PHP

1 Answer

0 votes
// number bindec( string $binary_string )

echo bindec('1111') . "<br />";
echo bindec('0001111') . "<br />";
echo bindec('111') . "<br />";

 
/*
run: 

15
15
7

*/

 



answered Jun 2, 2016 by avibootz
...