Quote:$find = "web design services"; $string = "This is linked to Web design services . Find out more."; the output should be: This is linked to Web$design$services . Find out more. and also preg replace to revert it back to This is linked to Web design services
$finalstring = preg_replace('/('.$find.')\b/iU', '<a href="asdf.com">\1</a>', $string,-1,$i);