[PHP] Rewrite img and a tags.
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. Thanks. //Laban -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Rewrite img and a tags.
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. If you're writing one of those anonymous browsing programs where everything is requested through PHP and shown on your site with the links rewritten, there's already one written on phpclasses.org. See how they do it. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Rewrite img and a tags.
* 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