Parsing GeoCache GPX with PHP
While working on the new cache pages for this site I came across the interesting task of parsing GPX files with PHP. SimpleXML is quite easy to use and with the children() function you can use namespace extensions – for example with GeoCaching exported GPX files. You can get an awful lot more information from a GeoCache GPX than with standard XML parsing.
The following is an example of a GPX file from the Geocaching site:
Now, as you can see there is a large amount of data contained within this file. Using PHP and SimpleXML you can extract this data quite easily, by doing something similar to this: