* Thus wrote Anthony Ritter: > Greetings, > > I'm using an RSS feed from the New York Times and right now the a href link > takes the user to the same window. > > I'd like the link to open in it's own window by using the target .html > attribute. > > I was hoping that I could use the eregi_replace() call by inserting: > > <a href="http://\\0">target="_blank">\\0</a> > > where it matches any character between the <link></link> string in the URL.
Hi, I'm not sure what format the url's are in, but here are a few pieces of code you can try. Format: <a href="http://www.news.com/article.php?aid=4">News Article</a> <?php $articleurl = "<a href=\"http://www.news.com/article.php?aid=4\">News Article</a>"; $broken = explode("\">", $articleurl); $modified_url = "$broken[0]\" target=\"_blank\">$broken[1]"; Result: <a href="http://www.news.com/article.php?aid=4" target="_blank">News Article</a> ----------------------------------------------------------------- Thank you, Richard Bewley [EMAIL PROTECTED] Equinox Systems and Development Website: http://www.eq-dev.com/ Also, please look at our webhosting services, specializing in business web hosting starting from $15 per month! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php