array_key_exists is not working

array_key_exists does NOT work recursive (as Matti Virkkunen already pointed out). Have a look at the PHP manual, there is the following piece of code you can use to perform a recursive search: <?php function array_key_exists_r($needle, $haystack) { $result = array_key_exists($needle, $haystack); if ($result) return $result; foreach ($haystack as $v) { if (is_array($v)) { $result … Read more

Is it okay to use array[key] in PHP?

It is not considered as OK — even if it will work in most cases. Basically, when PHP sees this : echo $array[key]; It will search for a constant, defined with define, called key — and, if there is none, if will take the ‘key’ value. But, if there is something like this earlier in … Read more