Can someone explain why PHP behaves the way it does, in this example?
I have this little demo script:
<?php $arr = array('apple', 'orange', 'banana'); var_dump(in_array('no i dont have this here!!!', array_keys($arr))); // return true var_dump(array_key_exists('no i dont have this here!!!', $arr)); // returns false ?>
Now my question is: Why does in_array() returns true in this case? I thought that these constructs would return the same (false).
Thanks for your help.