View Single Post
Old 02-18-2008, 05:34 PM   #1 (permalink)
meshi
The Contributor
Upcoming Programmer 
 
meshi's Avatar
 
Join Date: Oct 2007
Posts: 44
Thanks: 0
meshi is on a distinguished road
Default multiple search highlighting text

please anyone could help me with this problem

i have a code
PHP Code:
function highlight($c,$q){
 
$q=explode('|',$q);
 for(
$i=0;$i<sizeOf($q);$i++)
  
$c=preg_replace("/($q[$i])(?![^<]*>)/i","<span class='z'>\${1}</span>",$c);
 return 
$c;

this is ok but the problem is when i input lets say c|oracle only c will highlighted.it should be c and oracle will be highlighted.and if i put c++|c## only c also highlighted not the whole word c++ and c##
meshi is offline  
Reply With Quote