arrays - php in_array() usage -


i have array of data , checking result using in_array() function, yet reason returning false???

here code:

    var_dump($result);     var_dump(in_array("result", $result)); 

and here output:

array(4) {   ["timestamp"]=>   string(29) "#wed jul 20 22:00:32 pdt 2011"   ["cause"]=>   string(34) "username , password not match"   ["result"]=>   string(5) "false"   [""]=>   null } bool(false) 

i'm confused???

you looking key not value. want use function:

http://php.net/manual/en/function.array-key-exists.php


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -