3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = '<p class="geo"> <abbr class="latitude" title="52.19166">52.19166</abbr> <abbr class="longitude" title="-2.23108">-2.23108</abbr> </p>'; preg_match('/class="latitude"\s*title="([^"]+)"/', $str, $lat); preg_match('/class="longitude"\s*title="([^"]+)"/', $str, $lon); echo '<latitude>'.$lat[1].'</latitude>'; echo '<longitude>'.$lon[1].'</longitude>';
Output for 4.3.0 - 5.6.22, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
<latitude>52.19166</latitude><longitude>-2.23108</longitude>