聘我网

新概念招聘3.0

PHP代表二进制的前缀是什么呢?

vote up0vote downstar

0表示八进制

0x表示十六进制

有没有表示二进制的?

 

1 个答复

vote up0vote downcheck

PHP只支持10,8,16进制:

Integer s can be specified in decimal (base 10), hexadecimal (base 16), or octal (base 8) notation, optionally preceded by a sign (- or +).

To use octal notation, precede the number with a 0 (zero). To use hexadecimal notation precede the number with 0x.

但是可以试用bindec():

echo bindec('110011'); 

输出

51
链接

您的回答





不是您要找的问题? 浏览其他含有标签 的问题或者 自己问个.