Finding the previous and next links using SimpleXml

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:
// 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";
    }
  }
}

41 comments:

  1. How do i add previous and next post to my blog. i cannot do it :(

    ReplyDelete
  2. Soon as I get home, soon as I get home from work
    Girl I’ll be around, never let you down
    For all that it’s worth
    I give good love (good love, good love, good love, good love)
    I give good love (good love, good love, good love, good love)
    perth strippersfree porn

    ReplyDelete
  3. Close your eyes, give me your hand, darlingDo you feel my heart beating
    Do you understand
    Do you feel the sameEscorts SydneyEscort Accompagnatrici

    ReplyDelete
  4. Do you understand
    Do you feel the same
    Am I only dreaming
    Is this burning an eternal flameescorts sydneyshop sex

    ReplyDelete
  5. I believe it's meant to be, darling
    I watch you when you are sleeping
    You belong with me
    Do you feel the samelive sexfree porn

    ReplyDelete
  6. You belong with me
    Do you feel the same
    Am I only dreaming
    Or is this burning an eternal flamelivesexSydney Escorts

    ReplyDelete
  7. Say my name sun shines through the rain
    A whole life so lonely
    And then you come and ease the pain
    I don't want to lose this feelingUK Escortfree porn

    ReplyDelete
  8. Close your eyes, give me your hand, dảlingDo you feel my heart beatingDo you understandDo you feel the samefree pornsydney escort

    ReplyDelete
  9. Close your eyes, give me your hand, darling
    Do you feel my heart beating
    Do you understand
    Do you feel the samefree pornsydney escort

    ReplyDelete
  10. Do you understand
    Do you feel the same
    Am I only dreaming
    Is this burning an eternal flameMelbourne EscortsEscort

    ReplyDelete
  11. I believe it's meant to be, darling
    I watch you when you are sleeping
    You belong with me
    Do you feel the samesex videoLondon Escorts

    ReplyDelete
  12. I believe it's meant to be, darling
    I watch you when you are sleeping
    You belong with me
    Do you feel the sameEscortweb cam chat

    ReplyDelete
  13. You belong with me
    Do you feel the same
    Am I only dreaming
    Or is this burning an eternal flameproduto eroticoEscort Sydney

    ReplyDelete
  14. Ooh, if there's one thing I hang ontoThat gets me through the night
    I ain't gonna do what I don't want to
    I'm gonna live my lifecelebrity photosbest hgh

    ReplyDelete
  15. Close your eyes, give me your hand, darling
    Do you feel my heart beating
    Do you understand
    Do you feel the sameLas Vegas Escortfree porn

    ReplyDelete
  16. Do you understand
    Do you feel the same
    Am I only dreaming
    Is this burning an eternal flameLas Vegas Escortfree porn

    ReplyDelete
  17. I believe it's meant to be, darling
    I watch you when you are sleeping
    You belong with me
    Do you feel the samefree webcamsVegas Escort

    ReplyDelete
  18. You belong with me
    Do you feel the same
    Am I only dreaming
    Or is this burning an eternal flamecam chatVegas Escorts

    ReplyDelete
  19. You belong with me
    Do you feel the same
    Am I only dreaming
    Or is this burning an eternal flameweb cam to camsydney escorts

    ReplyDelete
  20. Say my name sun shines through the rain
    A whole life so lonely
    And then you come and ease the pain
    I don't want to lose this feelingfree webcamsVegas Escorts

    ReplyDelete
  21. Ooh, if there's one thing I hang onto
    That gets me through the night
    I ain't gonna do what I don't want to
    I'm gonna live my lifechat sexfree porn

    ReplyDelete
  22. Shining like a diamond, rolling with the dice
    Standing on the ledge, show the wind how to fly
    When the world gets in my face
    I say, have a nice day
    Have a nice dayfree webcamsprodutos eroticos

    ReplyDelete
  23. Shining like a diamond, rolling with the dice
    Standing on the ledge, show the wind how to fly
    When the world gets in my face
    I say, have a nice day
    Have a nice dayfree webcamsprodutos eroticos

    ReplyDelete
  24. Ooh, if there's one thing I hang onto
    That gets me through the night
    I ain't gonna do what I don't want to
    I'm gonna live my lifeLas Vegas Escortfree webcams

    ReplyDelete
  25. Say my name sun shines through the rain
    A whole life so lonely
    And then you come and ease the pain
    I don't want to lose this feelingEscortVegas Escort

    ReplyDelete
  26. Ooh, if there's one thing I hang onto
    That gets me through the night
    I ain't gonna do what I don't want to
    I'm gonna live my lifefree pornfree webcams

    ReplyDelete
  27. Ooh, if there's one thing I hang onto
    That gets me through the night
    I ain't gonna do what I don't want to
    I'm gonna live my lifefree pornvibrador

    ReplyDelete
  28. Close your eyes, give me your hand, darling
    Do you feel my heart beating
    Do you understand
    Do you feel the sameLondon Escortcam sex

    ReplyDelete
  29. Say my name sun shines through the rain
    A whole life so lonely
    And then you come and ease the pain
    I don't want to lose this feelingUK Escortcam live

    ReplyDelete
  30. Close your eyes, give me your hand, darling
    Do you feel my heart beating
    Do you understand
    Do you feel the sameLas Vegas Escortcam to cam

    ReplyDelete
  31. vibrators for womensexleksaker på nätetSoon as I get home, soon as I get home from work
    Girl I’ll be around, never let you down
    For all that it’s worth

    ReplyDelete
  32. How do i add previous and next post to my blog. i cannot do it :(Elektriske dildoerGold Coast Escorts

    ReplyDelete
  33. Cheap and Best Independent Call Girl Raipur offers top class female, college girls, housewives, Russian and models at an affordable rate. Book high profile Raipur Escorts services at your place.


    Raipur Escorts
    Raipur Call Girls
    Call Girls in Raipur
    Raipur Escorts Whatsapp Number
    Raipur Call Girls Photos
    Indian Escorts service
    Indian Call Girls
    Russian Call Girls
    Russian Escorts
    Russian Escorts Service
    Busty Call Girls
    Busty Escorts Service
    Busty Escorts
    High Class Call Girls
    High Class Escorts Service
    High Class Escorts
    Models Escorts
    Models Escorts Service
    Models Call Girls

    ----------------------------------------------

    Ahmedabad Escorts service provider agency offers you, genuine call girls, at a cheap rate like Russian, Models, Indian, Ukraine and Chinees, etc. This is time to take advantage of these sexy babes. Call us at 24*7.


    Ahmedabad Escorts
    Ahmedabad Escort
    Ahmedabad Escorts Service
    Ahmedabad Escorts Agency
    Independent Ahmedabad Escorts
    Ahmedabad Call Girls
    Cheap Escorts Ahmedabad
    Call Girls in Ahmedabad
    Ahmedabad Escorts Whatsapp Number

    ReplyDelete
  34. I am Pooja Pathak Bangalore escorts and I offer high-class Independent escorts services in Bangalore in your budget with 100 % satisfaction guarantee.


    Bangalore Escorts
    Bangalore Escort
    Bangalore Escorts Service
    Bangalore Escorts Agency
    Independent Bangalore Escorts
    Bangalore Call Girls
    Cheap Escorts Bangalore
    Call Girls in Bangalore
    Bangalore Escorts Whatsapp Number

    ----------------------------------------------

    We are Providing Russians, young call girls Gurgaon Escorts, Hot & Sexy Escorts in Gurgaon. Contact Escorts Service in Gurgaon directly for an Escort.


    Gurgaon Escorts
    Gurgaon Escort
    Russian Escorts Gurgaon
    Gurgaon Escorts Service
    Gurgaon Escorts Agency
    Independent Gurgaon Escorts
    Gurgaon Call Girls
    Cheap Escorts Gurgaon
    Call Girls in Gurgaon
    Gurgoan Escorts Whatsapp Number

    ReplyDelete
  35. I know it’s okay to have differing opinions, and I won’t unfollow someone because we disagree a few times. But I love blogs that mostly agree with my thoughts on books. That’s just because I don’t want to read about someone bashing a book that I adored, or praising a book that I despised. It puts me off! If it happens once in a blue moon, no biggie. But if we constantly have differing opinions, I just can’t click with the blog!
    escorte gatineau
    ottawa escort agency
    ottawa escort agencies
    Punggol Escorts
    Sengkang Escorts
    Serangoon Escorts

    ReplyDelete
  36. If you are looking for sexy VIP call girls photos, Just visit our website. Delhi escorts girls available 24/7 for Incall & outcall services in 4 & 5-star hotel.

    Saket Call girls Service
    Saket Call girls
    Saket Escorts
    Independent Saket Escorts
    Saket Escorts Photos


    ReplyDelete
  37. Are you looking for Kolkata Call Girls, VIP Models, and real fun, then you are in the right place. Our Kolkata Call Girls with Photo and number here.

    Alambazar Escorts Photos
    Alambazar Escorts
    Alambazar Call Girls

    ReplyDelete