X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP bindec() Function

PHP Math Reference PHP Math Reference

Example

Convert binary to decimal:

<?php
echo bindec("0011") . "<br>";
echo bindec("01") . "<br>";
echo bindec("11000110011") . "<br>";
echo bindec("111");
?>

Run example »

Definition and Usage

The bindec() function converts a binary number to a decimal number.

Tip: To convert decimal to binary, look at the decbin() function.


Syntax

bindec(binary_string);

Parameter Description
binary_string Required. Specifies the binary string to convert.
Note:
The parameter value must be a string!

Technical Details

Return Value: The decimal value of binary_string
Return Type: Float / Integer
PHP Version: 4+


PHP Math Reference PHP Math Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook