regex - Remove urls using PHP -


i'd remove anchor tags , actual urls.
instance, <a href="http://www.example.com">test www.example.com</a> become test.

thanks.

to complement gd1's answer, urls:

// http(s):// $txt = preg_replace('|https?://www\.[a-z\.0-9]+|i', '', $txt); // www. $txt = preg_replace('|www\.[a-z\.0-9]+|i', '', $txt); 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -