bindec():Decimal equivalent of Binary string

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>"; 
Syntax
number bindec(string $binary);
ParameterDESCRIPTION
$binaryRequired : 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.

Math Functions base_convert(): Convert number From any base to other
decbin() Binary equivalent of decimal number
Subscribe to our YouTube Channel here


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com







    Post your comments , suggestion , error , requirements etc here





    PHP video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer