I am utilizing the HTML DOM Parser for PHP and am having difficult trying to extract the coordinates out of this javascript. Any clue how to? Thanks.
<script type="text/javascript">
//<![CDATA[
LoadMarker(parseFloat(45.5364416896354),parseFloat(-122.959525248125), 'seizures', '141101942', 'wccca');
LoadMarker(parseFloat(45.3885251463509),parseFloat(-122.813856693134), 'cardiac arrest', '141101935', 'wccca');
resizeIncidentScrollBar('#wccca-incidents');
LoadMarker(parseFloat(45.3926967266394),parseFloat(-122.622226603465), 'chest pain', '141101208', 'ccom');
LoadMarker(parseFloat(45.266375649134),parseFloat(-122.676613858032), 'hemorrhage', '141101206', 'ccom');
LoadMarker(parseFloat(45.0866856873256),parseFloat(-122.667733219612), '*m82', '141101198', 'ccom');
resizeIncidentScrollBar('#ccom-incidents');
updateMarkers();
Sys.Application.initialize();
Sys.Application.add_init(function() {
$create(Sys.UI._Timer, {"enabled":true,"interval":2000,"uniqueID":"tmrIncidents"}, null, null, $get("tmrIncidents"));
});
//]]>
</script>
PHP:
<?php
include 'simple_html_dom.php';
// Get WCCCA's html file
$html = file_get_html('http://www.wccca.com/PITSv2/');
$node = $html->find('script[type=text/javascript]', 4);
$DOMelement = array("LoadMarker(parseFloat(45.5364416896354),parseFloat(-122.959525248125)");
preg_match_all('/\d+(\.\d+)?/', $DOMelement[0], $matches);
print_r($matches[0]);
?>
php nameofyourfile.php.)