Does anybody know, how it can be, that this code echoes yahoo? There is clearly no 4th array with the key ‘something’, but it keeps thinking it’s like that. Bug? Feature?
$array = array('a' => array('b' => array('c' => 'test')));
echo '<pre>';
var_dump($array);
echo '</pre>';
if (isset($array['a']['b']['c']['something'])) {
echo 'yahoo';
}
Because PHP thinks you are checking the ‘something’th place of the string ‘test’. Remember, strings are arrays of characters. try to echo $array[‘a’][‘b’][‘c’][‘something’].
::EDIT::
I Explained it, I didn’t say it made sense. 😛