3v4l.org

run code in 150+ 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 $results[1][$i] . ' ' . $results[2][$i];
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.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!" } } http://www.google.com/ Go to Google!