// assuming you have read your XML string into the $sxml object
$links = $sxml->children('http://www.w3.org/2005/Atom');
foreach($links as $link) {
foreach($link->attributes() as $key => $value) {
if ($key == 'rel') {
print "$key => $value\n";
}
}
}
Showing posts with label simplexml. Show all posts
Showing posts with label simplexml. Show all posts
Finding the previous and next links using SimpleXml
Posted by
Jochen Hartmann (Google)
on
Monday, August 25, 2008
If you find yourself in a situation where you need to page through a large feed of entries with SimpleXML, you can use the below snippet to retrieve the 'previous' and 'next' links:
Subscribe to:
Comments (Atom)