模糊查询多条 高亮求 优化
==========拼接SQL 模糊查询
foreach ($getPar as $key => $val){
$searchVal.= "content LIKE '%{$val}%'";
if($_count-1 >$key){
$searchVal.="or ";
}
}
--------------
//替换高亮 这里采用两个循环 ,请问下 用一个循环怎么实现
while ($row = mysql_fetch_assoc($rs)){
if($row['content']){
foreach ($getPar as $key => $val){
$row['content']= str_replace($val, '<font color="red"><b>'.$val.'</b></font>',$row['content']);
}
}
$user[] = $row;
}