phorcon3 Posted February 10, 2011 Share Posted February 10, 2011 $str = preg_replace('/('.$word.')/i', '<em>\1</em>', $str); how come this doesn't work when $word = 'http://www.google.com', or any other URL? Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted February 10, 2011 Share Posted February 10, 2011 what is in $str? Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted February 10, 2011 Share Posted February 10, 2011 i get Warning: preg_replace() [function.preg-replace]: Unknown modifier '/' you'll need to escape the slashes in the URL if you want to use it as a match pattern. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.