3v4l.org

run code in 300+ PHP versions simultaneously
<?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>';

preferences:
57.33 ms | 402 KiB | 5 Q