Quote:
print $array[foo];
PHP looks for a constant named foo first, if it does not exist then
it'll shout an error of level E_NOTICE and then look for the key foo
(which is what you wanted) ...
error_reporting can be set about anywhere, including php.ini, .htaccess
and the error_reporting() function. And some code:
define('a', 'b');
$arr = array('a' => 'apple', 'b' => 'banana');
print $arr[a]; // banana
print $arr['a']; // apple
Moral of the story is you should always surround your array keys with
quotes! ;)
A little searching goes a long way :p