sniperscope Posted November 15, 2011 Share Posted November 15, 2011 I have something like below $j = explode("-", $ROW['options']); if(array_search("src_str", $j) == false) echo '_no'; // This doesn't work Also i tried $j = explode("-", $ROW['options']); if(!in_array("src_str", $j)) echo '_no'; // This also doesn't work Is this bug or am i doing something wrong? Quote Link to comment https://forums.phpfreaks.com/topic/251162-in_array-doesnt-work/ Share on other sites More sharing options...
Pikachu2000 Posted November 15, 2011 Share Posted November 15, 2011 It's usually a whitespace issue when this question comes up. Trim the values in the db query and see what happens. Quote Link to comment https://forums.phpfreaks.com/topic/251162-in_array-doesnt-work/#findComment-1288240 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.