PHP Math Function : bindec()

The bindec() function is used to convert a binary number to a decimal number. The syntax is :
 bindec( binary_string );
Where binary_string specifies the binary string to convert.

Example :
<?php
  
  echo bindec("11011") . "<br/>";
  echo bindec("1111") . "<br/>";
  echo bindec("10010110") . "<br/>";

?>
Output :

27
15
150


Next Topic :

No comments:

Post a Comment