Hallo Linuchs,
probiere diesen Ansatz:
<?php
$lat = array();
$lon = array();
$xmldoc = new DOMDocument();
$xmldoc->loadxml(file_get_contents("daten.xml"));
$trkptnodes = $xmldoc->getElementsByTagName("trkpt");
foreach($trkptnodes as $trkptnode)
{
$lat[] = $trkptnode->getAttribute("lat");
$lon[] = $trkptnode->getAttribute("lon");
}
print_r($lat);
print_r($lon);
?>
Getestet mit dieser "daten.xml":
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<gpx>
<trkpt lat="53.188185" lon="7.216993"></trkpt>
<trkpt lat="53.184541" lon="7.217456"></trkpt>
</gpx>
Array ( [0] => 53.188185 [1] => 53.184541 ) Array ( [0] => 7.216993 [1] => 7.217456 )
Grüße,
Thomas