蒙国造博客
  • 首页
  • PHP启示录
  • PHP设计模式
  • 技术
  • 关于&捐赠
  • 中文 (中国)
    English中文 (中国)

标签: 比较

为什么in_array(0, [‘a’, ‘b’, ‘c’])返回true

2017-03-25 5.7k PHP教程 PHP, 比较 3评论
在PHP中,数据会自动转换类型后再进行比较。 这样可能会导致一些费解的现象: in_array(0, ['a', 'b', 'c']) // 返回bool(true),也就相当于数组中有0 array_search(0, ['a', 'b', 'c']) // 返回int(0),也就是第一个值的下标 0 == 'abc' // 返回bool(true),也…

标签云

Android CentOS cURL Dart Docker flutter git Java JavaScript JQuery Json Linux MVC MySQL MySQL优化 Nginx Opencart PHP PHP-FPM PHP7 PHPStorm PHP框架 PHP调试 Redis scrapy Session spring boot ThinkPHP Ubuntu VirtualBox Windows WordPress Yaf教程 下载 函数 压缩 性能分析 数据库 数组 正则表达式 爬虫 算法 缓存 虚拟机 随机数
Theme: Maizi. Powered by WordPress.