The Little Guy Posted January 14, 2010 Share Posted January 14, 2010 I am searching an array, the array has ~600 values in it, 'have' is the 212th value in the array, so... why isn't my thing finding 'have' in the array? Is there a limit to the number of values that can be searched in in_array? If I manually search the array I can see that it is in the array.... It finds other things in the array, such as "do", "in" why does it not find "have"? if(in_array('have', $stopWords)){ echo 'have is in the array'; }else{ echo 'have is not in the array'; } Quote Link to comment https://forums.phpfreaks.com/topic/188407-have-is-not-in-the-array/ Share on other sites More sharing options...
greatstar00 Posted January 14, 2010 Share Posted January 14, 2010 can u post your array values also? so, we can take a deeper look Quote Link to comment https://forums.phpfreaks.com/topic/188407-have-is-not-in-the-array/#findComment-994643 Share on other sites More sharing options...
PFMaBiSmAd Posted January 14, 2010 Share Posted January 14, 2010 What does using var_dump() on the 212'th element of $stopWords show for the value? Quote Link to comment https://forums.phpfreaks.com/topic/188407-have-is-not-in-the-array/#findComment-994645 Share on other sites More sharing options...
The Little Guy Posted January 14, 2010 Author Share Posted January 14, 2010 string(5) "have " hmm... looks like there is an extra space... I wonder how that got there... There isn't a space in the text file... guess I'll do trim() on it. Quote Link to comment https://forums.phpfreaks.com/topic/188407-have-is-not-in-the-array/#findComment-994648 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.