Hi! I am trying to extract the latitude and longitude of a google maps url. Such an url could look like this:
$url = 'http://maps.google.com/?ie=UTF8&ll=39.811856,11.309322&spn=0,0.485802&t=h&z=12&layer=c&cbll=39.311856,11.519322&panoid=1hltSSOoqv5H1dVKZWFkaA&cbp=13,117.95,,1,16.71';
As you can see, there's several location sets in the url. The cbll variable seems to be the right one in my case.
This is what I came up with:
preg_match("~&cbll=(-?\d+\.?\d*),(-?\d+\.?\d*)~", $url, $matches);
The problem: The preg_match seems to match the first '&ll=' in the url, and not the cbll part. I get the "&ll=" part of the url as result.