$strSubject= preg_replace('/\b'.$strWord.'\b/i', '<b>'.$strWord.'</b>', $strSubject);
above code works in php 5.2.6 but not working in php 5.2.9 and get " warning,unknow modifer....." error. please help
You probably have a meta character unescaped in $strWord. Try this...
$strSubject= preg_replace('/\b'.preg_quote($strWord, '/').'\b/i', '<b>'.$strWord.'</b>', $strSubject);
Also, you could just use this :)
$strSubject = preg_replace('/\b('.preg_quote($strWord, '/').')\b/i', '<b>$1</b>', $strSubject);
var_dump($strWord);