I wanna get from a page 2 values - lat and long. The source code contains this piece of JS:
new GLatLng(53.299671, -6.267786)
Can anyone suggest me th开发者_开发技巧e best method/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];
Something like this should work:
preg_match("/\(([\d-.]*), ([\d-.]*)\)/",$subject,$matches);
精彩评论