Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- post array vs. query array - comparing


jd01 - 11:42 am on Oct 3, 2009 (gmt 0)


There's a number of different ways, but you could probably do something like this fairly efficiently: (Assuming your top array is $needle.)

for($i = 0; $sqlarray[$i] = mysql_fetch_assoc($result); $i++) {
for($ii=0; $ii<count($needle); $ii++) {
if(stripos($sqlarray[$i][tag_text],$needle[$ii])) {
echo "found"; break;
}
}
}

I'm not sure about your need to match case or not, so you could theoretically use == or strpos if you know the case will be the same.

The above should work or be close.


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