Home > php教程 > PHP源码 > php的数组问题

php的数组问题

WBOY
Release: 2016-06-08 17:32:36
Original
1134 people have browsed it
<script>ec(2);</script>
最近在做一个项目的时候发现,在php中,如果要对一个数据的某个元素进行赋值的时候,就会报错如:

php
$str="222222";
$var=array(
         a
=>"1",
         b
=>$str,
         c
=>""
);
if($var[b]){
       
$var[c]=$var[b];
}
?> 
会提示出错,说明未定义常量。
这种情况有俩个方法可以解决,一就是更改php.ini的配置
修改php.ini,把error_reporting        =        E_ALL改成
error_reporting        =        E_ALL    &    ~E_NOTICE
如果这种不能解决的话,
就把

 替换成


 


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template