I have the following array called $fruits:
Array
(
[response] => Array
(
[errormessage] => banana
)
[blah] => Array
(
[blah1] => blahblah1
[blah2] => blahblah2
[blah3] => blahblah3
[blah4] => blahblah4
)
)
Yet when I do:
isset($fruits['response']['errormessage']['orange'])
It returns true!
What on earth would cause such a strange behavior and how can I fix this?
Thanks!
[n]is also a way to access characters in a string:Use
array_key_exists, possibly in combination withis_array.