PHP正则表达式-获取纬度和经度

PHP正则表达式-获取纬度和经度,php,regex,google-maps,Php,Regex,Google Maps,我想从第2页的值中得到-横向和纵向。源代码包含这段JS: new GLatLng(53.299671, -6.267786) 有人能给我推荐最好的方法/regex吗?类似的方法应该可以: <?php $input = "new GLatLng(53.299671, -6.267786)"; preg_match("~GLatLng\(([0-9\.\-]+).*?([\.\-0-9]+)\)~i", $input, $match); echo $match[1]." and ".

我想从第2页的值中得到-横向和纵向。源代码包含这段JS:

new GLatLng(53.299671, -6.267786)

有人能给我推荐最好的方法/regex吗?

类似的方法应该可以:

<?php 
$input = "new GLatLng(53.299671, -6.267786)"; 
preg_match("~GLatLng\(([0-9\.\-]+).*?([\.\-0-9]+)\)~i", $input, $match); 

echo $match[1]." and ".$match[2];
preg_match("/\(([\d-.]*), ([\d-.]*)\)/",$subject,$matches); 

@创世记:可能是括号里的那些值。非常感谢,如何得到那些匹配的值$匹配[1]和$match[2]?你救了我一天!非常感谢:-如果我帮助了你,请帮助我:如果你不知道如何做,请点击该链接