Search w3schools.com:

SHARE THIS PAGE

PHP bindec() Function


PHP Math Reference Complete PHP Math Reference

Definition and Usage

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

Syntax

bindec(binary_number)

Parameter Description
binary_number Required. Specifies the binary number to convert


Example

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

The output of the code above will be:

3
1
1587
7


PHP Math Reference Complete PHP Math Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]