I am using the simple_html_dom PHP library to scrape some content of a page. I would like to extract the latitude and longitude from the page but I need a regex expression to access these value since these values are only available on the page in a Javascript function:
function loadMap() { setTimeout("setMap(39.364016, 3.226783, 'Hotel Casa',
'icon.png', 'key')", 200)};
I got the above example in a string. What would be a well optimized regex expression (using PHP) to extract the latitude (39.364016) and the longitude (3.226783) from this string? I am new to regex expressions so my attempts so far have not been successful, I hope someone could can help me out. Thank you.
/setMap\((\d+\.\d*), (\d+\.\d*)/
- raina77ow