* Thus wrote Simon Fredriksson ([EMAIL PROTECTED]):
>
> How can I easiest rewrite A and IMG tags? I'm fetching a page with
> fsockopen() and I need to rewrite these tags before sending it on to a user.
>
> My own theory is that it's made with Regular Expressions. I just don't
> know these myself.
The documentation for preg_match_all has an excelent pattern for
matching html tags:
preg_match_all ("/(<([\w]+)[^>]*>)(.*)(<\/\\2>)/", $html, $matches);
HTH,
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php