3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $content = '<a href="http://externalsite.com">external site</a>'; if ( ! preg_match_all( "/(<a.*>)(.*)(<\/a>)/ismU", $content, $outbound_links, PREG_SET_ORDER ) ) { return $content; } var_dump( $outbound_links );
Output for 4.3.0 - 7.1.0
array(1) { [0]=> array(4) { [0]=> string(51) "<a href="http://externalsite.com">external site</a>" [1]=> string(34) "<a href="http://externalsite.com">" [2]=> string(13) "external site" [3]=> string(4) "</a>" } }