BINDEC
Binary to decimal
SYNTAX
bindec ( string $binary_string ) : number
PARAMETERS
binary_string
The binary string to convert. Any invalid characters in binary_string are silently ignored.
BINARY | DECIMAL |
---|---|
0 | 0 |
1 | 1 |
10 | 2 |
... | ... |
111111111111111111111111111111111111111111111111111111111111110 | 9223372036854775806 |
111111111111111111111111111111111111111111111111111111111111111 (63) | 9223372036854775807 (largest signed integer) |
1000000000000000000000000000000000000000000000000000000000000000 | 9223372036854775808 |
... | ... |
1111111111111111111111111111111111111111111111111111111111111110 | 18446744073709551614 |
1111111111111111111111111111111111111111111111111111111111111111 (64) | 18446744073709551615 (largest unsigned integer) |
RETURN
The decimal value of binary_string
EXAMPLES
1
0
0
2
1
3
2
4
9223372036854775806
5
9223372036854775807
6
9223372036854775808
7
18446744073709551616
8
18446744073709551616