CodeIgniter Forums
exclude from being replaced - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: exclude from being replaced (/showthread.php?tid=27606)



exclude from being replaced - El Forum - 02-16-2010

[eluser]basty_dread[/eluser]
hi guys. please help me with this problem thank you very much
how to exclude the one with link from being replaced?

Code:
$find = "web design";
$string = "WEB DESIGN Web Design web design <a href='google.com'>Web design las vegas</a>";
$finalstring = preg_replace('/('.$find.'\b)/iU', '<a href="http://google.com">\1</a>', $string,-1,$i);
echo $finalstring;
echo '<br />'.$i;



exclude from being replaced - El Forum - 02-16-2010

[eluser]basty_dread[/eluser]
Thanks for helping.


exclude from being replaced - El Forum - 02-16-2010

[eluser]basty_dread[/eluser]
please help regexp experts.. pls. help.. tnx a lot