I am trying to do an if(preg_match) but it just returns all values instead of only the ones matched. Why?
$fsear = explode(",", $fsearch);
for($a=0; $a<count($fsear); $a++)
{
$match = $fsear[$a];
if(preg_match("/$match/i", $fdescription))
print "<tr><td><b><font face='arial, helvetica, verdana' size='1' color='#0000FF'><a href='$PHP_SELF?itemsitemap=$itemsitemap&itemID=$itemID&category=$category&subcategory=$subcategory&sI=$sI&hS=$hS'>$product $row[2] $row[1]</a></FONT></b><br><font face='arial, helvetica, verdana' size='1' color='#000000'>$desc</FONT><BR></td></tr>";
else
print "<tr><td>None</td></tr>";
}
This prints out the href for every loop when it should only return two. if I echo out something like $match inside if the if statement, then it returns match only twice, but still prints out the href for every item and not just the matches