문제

In php how do I convert a string "1010101010" into the integer value represented by this binary number?

eg "10" would go to 2, "101" would go to 5

도움이 되었습니까?

해결책

Use bindec() function to convert from binary to decimal:

$value = bindec("10101011010101");

다른 팁

Try the bindec() function.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top