2012-06-20

php : Notice: Use of undefined constant

I receive this error on my page..
Notice: Use of undefined constant one - assumed 'one' in
How can to fix this??

Answer:
Let's see your code
error_reporting(2047); 
$a=array(1=>'ONE','one'=>1);
$s.=$a[one]."<br>";

die($s);

As we see. One should be type $a['one'] or this will happen: FYI the right answer is 1 not ONE

the code are like this
<?php
error_reporting(2047);
define('one',1);
$a=array(1=>'ONE','one'=>1);
$s.=$a[one]."<br>";
$s.=$a['one']."<br>";

die($s);
If you define one (or perhaps another script).. The result is not 1 but ONE. For the next time.. LET's More carefully..
Another way if you can't edit all and don't have time.. edit
error_reporting(2047);
into (if there is no reporting.. add it)
error_reporting(0);

Tidak ada komentar: