Is there a easy way to separate the output from SimpleXML into pages? Let's say the XML file got 200 elements but I want to split it into 20 elements on each page. So it would be like index.php?page=1
?
$xml = new SimpleXMLElement(file_get_contents("demofile.xml"));
$per_no = $xml->children();
echo count($per_no) . ' are now active<br />';
$cnt = 0;
foreach ($xml->xpath('/webcams_online/webcam') as $node) {
if ($cnt == 10) {
break;
}
$itemXML = array(
'account' => $node['account'],
'nickname' => $node['nickname'],
'number_visitors' => $node['number_visitors']
);
$cnt++;
?>
<?php echo $itemXML['account']; ?>
<?php
}