3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = '<a href="http://www.google.com/" class=l2>Go to Google!</a>'; preg_match_all('/<a href="([^"]+)" class=l.+?>([^<]+)<\/a>/', $string, $results); var_dump( $results); for( $i = 0; $i < count( $results[1]); $i++) echo 'URL: ' . $results[1][$i] . ', Title: ' . $results[2][$i];
Output for 4.3.0 - 7.2.0
array(3) { [0]=> array(1) { [0]=> string(59) "<a href="http://www.google.com/" class=l2>Go to Google!</a>" } [1]=> array(1) { [0]=> string(22) "http://www.google.com/" } [2]=> array(1) { [0]=> string(13) "Go to Google!" } } URL: http://www.google.com/, Title: Go to Google!