Jump to content

XML Pagination with PHP


AlexGomez

Recommended Posts

Hi all,

 

As anyone done any work with pagination where the input data is an XML document?

 

Basically I have a PHP page that reads in an XML document. I would like to break up it up so that it only displays 25 results per page. The code snippet below shows what I've done so far. Unfortunately, nothing is being printed out. Any help would be greatly appreciated.

 

Cheers

Alex

 


//load XML from URL
$xml = simplexml_load_file("https://pod.ncl.ac.uk/rampart/live/getgroups.php?user=$user");

foreach ($xml->xpath("//ns:displayName") as $id)
{
  		for($x=($currentpage*25);$x<(($currentpage*25)+25);$x++)
  		{
  			print_r($id($x));
		}
}

 

Link to comment
https://forums.phpfreaks.com/topic/112178-xml-pagination-with-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.