What's the prefix for binary in PHP?

前端 未结 4 832
南方客
南方客 2020-12-03 02:31

It\'s neither 0x nor 0; what is it? Is there?

4条回答
  •  情歌与酒
    2020-12-03 03:12

    Check the manual: PHP only supports decimal, hexadecimal and octal integer notation, but you can use bindec() instead.

    Also, keep in mind that each hex digit represents 4 bits, so it's easy to convert between binary notation and hex. The same is true for octal, but for various reasons it's used less often in practice.

提交回复
热议问题