Hey guys, Really need some help with preg_replace that is driving me insane. I have a foreach loop such as this <?php foreach ($example as $row){ $id=$row['id']; $string=$row['string']; } Code (markup): I would like to do the following in each loop <?php foreach ($example as $row){ $id=$row['id']; $string=$row['string']; //$bad_words=array('bad','rotten'); //REPLACE EACH WORD apart from "bad words" INSIDE THE STRING WITH <a href="$row['id']">WORD FROM THE STRING</a> } Code (markup): Help really appreciated Cheers, Stuart