php nextint PHP – Manual: Integer 整型
php nextint PHP – Manual: Integer 整型
————————————————————————-
:
((int) 010); // 8
((int) “010”); // 10
First one is octal so the is . But what about the when “010” to . it be also 8 ?
————————————————————————–
:

to an using (int) will cast to the base, which is 10.
a to a this way does not take into the many ways of an value in PHP ( zero for base 8, “0x” for base 16, “0b” for base 2). It will look at the first in a and them to a base 10 . will be off they have no in , so you will end up with the value 10 for (int)”010″.
an value bases using (int)010 will take into the ways of an . A zero like in 010 means the is in octal ,using (int)010 will it to the value 8 in base 10.
This is to how you use 0x10 to write in (base 16) . Using (int)0x10 will that to the base 10 value 16php nextint PHP – Manual: Integer 整型,using (int)”0x10″ will end up with the value 0: since the “x” is not a valuephp nextint PHP – Manual: Integer 整型,after that will be .
If you want to the “010” as an octal valuephp nextint, you need to PHP to do so. (“010”, 8) will the in base 8 of the base 10, and you will end up with the value 8. You could also use (“010”) to the octal to the value 8. is to use (“010”, 8,10) to the “010” from base 8 to base 10php nextint, this will the “8” of the 8.
a to an the same the logic used by the :
the value of var, using the base for the (the is base 10).
a base as the , a cast does not,so using (int) will treat a as being in base 10.
php > ((int) “010”);
10
php > ((“010”));
10
php > ((“010”php nextint, 8));
1. 本站所有资源来源于用户上传和网络,如有侵权请联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系站长处理!
6. 本站不售卖代码,资源标价只是站长收集整理的辛苦费!如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。
7. 站长QQ号码 2205675299
资源库 - 资源分享下载网 » php nextint PHP – Manual: Integer 整型
常见问题FAQ
- 关于资源售价和售后服务的说明?
- 代码有没有售后服务和技术支持?
- 有没有搭建服务?
- 链接地址失效了怎么办?
- 关于解压密码

