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

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -