Welcome Guest, Not a member yet? Register   Sign In
SimpleXML to return a few items at a time
#2

[eluser]pickupman[/eluser]
Depends on it the XML is local or if you are fetching it, but it maybe wise to cache the contents as an array. I would convert the XML to an array using one of the recursive functions on the php.net [url="http://php.net/manual/en/book.simplexml.php"]simplexml[/url] documentation. Once you have it as an array, you could count the indexes to create your total rows. Then pass the pagination offsets to a for loop.
Code:
$i = $this->uri->segment(3,0);
for($i < ($i + 10); $i++)
{
   echo $arrayFromXML[$i]['ProductID']['PrName'];
}


Messages In This Thread
SimpleXML to return a few items at a time - by El Forum - 06-29-2012, 07:35 PM
SimpleXML to return a few items at a time - by El Forum - 06-29-2012, 08:23 PM
SimpleXML to return a few items at a time - by El Forum - 06-29-2012, 08:56 PM
SimpleXML to return a few items at a time - by El Forum - 06-30-2012, 05:51 AM
SimpleXML to return a few items at a time - by El Forum - 07-03-2012, 05:25 PM
SimpleXML to return a few items at a time - by El Forum - 07-07-2012, 02:21 PM
SimpleXML to return a few items at a time - by El Forum - 07-07-2012, 02:52 PM
SimpleXML to return a few items at a time - by El Forum - 07-07-2012, 03:58 PM
SimpleXML to return a few items at a time - by El Forum - 07-07-2012, 05:02 PM
SimpleXML to return a few items at a time - by El Forum - 07-07-2012, 05:04 PM
SimpleXML to return a few items at a time - by El Forum - 07-07-2012, 07:32 PM
SimpleXML to return a few items at a time - by El Forum - 07-07-2012, 07:38 PM
SimpleXML to return a few items at a time - by El Forum - 07-12-2012, 02:32 PM
SimpleXML to return a few items at a time - by El Forum - 07-12-2012, 08:33 PM
SimpleXML to return a few items at a time - by El Forum - 12-08-2012, 03:22 PM
SimpleXML to return a few items at a time - by El Forum - 12-09-2012, 03:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB