求助。偶尔大量出现Use of undefined constant index - assumed 'index'
我在调试页面时偶尔出现大量Use of undefined constant index - assumed 'index'错误。但是什么也没改,重新加载页面后又正常了。又遇到过这个问题的吗,请帮忙看看什么原因,谢谢。
2013-12-02 10:31:16 --> Severity: Notice--> Use of undefined constant index - assumed 'index' ...\application\controllers\main.php 929
ERROR - 2013-12-02 10:31:16 --> Severity: Notice--> Use of undefined constant index - assumed 'index' ...\application\controllers\main.php 929
ERROR - 2013-12-02 10:31:16 --> Severity: Notice--> Use of undefined constant index - assumed 'index' ...\application\controllers\main.php 929
ERROR - 2013-12-02 10:31:16 --> Severity: Notice--> Use of undefined constant index - assumed 'index' ...\application\controllers\main.php 929
ERROR - 2013-12-02 10:31:16 --> Severity: Notice--> Use of undefined constant index - assumed 'index' ...\application\controllers\main.php 929
贴 main.php 929 行代码 Hex 发表于 2013-12-2 18:58 static/image/common/back.gif
贴 main.php 929 行代码
是获取当前系统时间的毫秒部分的代码。for那一行。
function get_millisecond()
{
list($usec, $sec) = explode(" ", microtime());
$msec=round($usec*1000);
$len = strlen($msec);
if($len<3){
for($index =0; index<3-$len; $index++)
{
$msec = '0'.$msec;
}
}
return $msec;
}
li_lzw 发表于 2013-12-3 10:00 static/image/common/back.gif
是获取当前系统时间的毫秒部分的代码。for那一行。
function get_millisecond()
{
很明显,你少写了一个$符号
应该是 $index 你写成 index 了。
这样还能有不报错的时候?;P
页:
[1]