Quantcast
Viewing all articles
Browse latest Browse all 3

Answer by MrCode for PHP - Get only certain data from XML, not whole xml file?

SimpleXML can't partially read a document. Even with an XPath filter, the whole document is still parsed behind the scenes.

A possible solution is use a cronjob or scheduled task to regularly call a PHP script which downloads the XML, parses it and inserts the data into an SQL database (don't forget to delete the old data first).

When a visitor requests a page, just paginate the data using SQL queries on the database.


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>