Paging an XML file with PHP
I need to page an XML dataset in PHP.
The website I'm running is not high-vo开发者_如何学运维lume so an implementation that would query the whole XML serialized file for each page is ok, but I'd be interested in hearing also approaches that do it right from the start (maybe slicing the file in many smaller files).
What are some approaches to do this in PHP?
My personal preference is simplexml_load_string
since it makes handeling XML so much more easier using SimpleXMLElement
than using DOMDocument
- Define how many items are visible on a page
- Count all items in your dataset
- Select the actual offset from your dataset
精彩评论