【php】数组下标不加引号报Notice: Use of undefined constant

上一篇 / 下一篇  2010-11-19 19:57:27 / 个人分类:程序设计

php数组中,数组下标不加引号,就会报错:Notice: Use of undefined constant
如:$config[title]="FinalFantasy";
Notice: Use of undefined constant title

解决:title是个索引.是一定要加单引号的..
否则php会先去查找是否存在title这个常量.
然后再当索引处理.效率相差是很大的.


TAG:

 

评分:0

我来说两句

Open Toolbar