Re: regex help
| From: | Richard Lynch | Date: | Fri, 06 Sep 2002 00:20:18 +0000 |
| Subject: | Re: regex help | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-115372@lists.php.net to get a copy of this message | ||
><?php
>
>$str = 'hi <b>my friend</b>! <br /> this message uses html entities <a
>
>href="http://www.trini0.org">test</a>!';
>$str = preg_replace('/(<a
>href="http:\/\/.*">.*<\/a>)/',
>htmlspecialchars("$1"), $str);
Maybe I'm missing something here, but can't you just do:
$str = htmlspecialchars($str);
--
Like Music? http://l-i-e.com/artists.htm