A PHP XML parser script that provides an easy way to convert XML into native PHP arrays. It has no dependencies on any external libraries or extensions bundled with PHP. The entire parser is concisely written in PHP.
This project is actively maintained. If you spot an issue, please let me know through the Issues section on our Github project page: https://github.com/tursander/XML-Parser-in-PHP/issues
As XML becomes less popular, the need for a parser moves from constant to infrequent. It makes little sense to keep a parser resident in memory at all times for functionality that might be used once every few days.
For example, just to get SimpleXML going, you will need to have the libxml2 library installed on your system. You will need xml, libxml, and simplexml extensions installed for PHP. You will need to keep all those extensions in memory for each request.
In contrast, this simple parser is less than 500 lines of code and is only loaded when you need it. It has no dependencies, no required libraries or extensions, and will work on any modern PHP installation. The price you pay for that convenience is speed. It is much slower than SimpleXML. See the benchmarking section for details.
In short, this project makes sense for those who want to simplify their PHP install and use, have a need for a simple XML parser, but don't much care about speed.
PHP 5.4.0+
Just place the countries.xml and index.php files in a convenient location.
None, for now.
- Cezar Bumbaru - Initial work - tursander
See also the list of contributors who participated in all these projects.
This project is licensed under the MIT License - see the LICENSE.md file for details.