3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data = <<<EOF <html> <head> <link href='http://wendyandgabe.blogspot.com/favicon.ico' rel='icon' type='image/x-icon'/> <link href='http://wendyandgabe.blogspot.com/' rel='canonical'/> <link rel="alternate" type="application/atom+xml" title="O&#39; Happy Day! - Atom" href="http://wendyandgabe.blogspot.com/feeds/posts/default" /> <link rel="alternate" type="application/rss+xml" title="O&#39; Happy Day! - RSS" href="http://wendyandgabe.blogspot.com/feeds/posts/default?alt=rss" /> <link rel="service.post" type="application/atom+xml" title="O&#39; Happy Day! - Atom" href="http://www.blogger.com/feeds/5390468261501503598/posts/default" /> </head> <body> </body> </html> EOF; preg_match_all('/<link[^>]+>/i',$data, $urls); foreach($urls[0] as $url) { if(preg_match('/application\/rss\+xml/i', $url)) { preg_match('/href=["\']?([^"\'>]+)["\']?/i',$url, $match); echo $match[1]."\n"; } }
Output for 4.3.0 - 7.1.0
http://wendyandgabe.blogspot.com/feeds/posts/default?alt=rss