Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- simple in array question


tec4 - 4:41 am on Feb 24, 2012 (gmt 0)


No idea why this is not working for me...perhaps i'm just super tired and my logic is off but is driving me crazy! lol

Have a simple array, like:


$ret_array = Array ( [97381816989] => 1 [97381821414] => 1 [97381821534] => 1 [97381823199] => 1 )


and I try to check to see if the number 78 is in the array (which it should not be), like:


if (!in_array(78,$ret_array)) {
echo "NOT in array";
} else {
echo "IS in array";
}



The result is "Is in array" when I run this..also tried replacing the numeric 78 with a string like "word" and it still echos "IS in array" - am I overlooking something? lol

Thanks for the help!


Thread source:: http://www.webmasterworld.com/php/4421212.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com