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

40 comments:

Sekeping Hati said...

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

obama said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Just A Spammer said...

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

Justlia From TGR said...

High Class London escortsRocks Off Naughty BoyDo you understand
Do you feel the same
Am I only dreaming

kosovohp said...

socks5 | socks proxy | proxy free | proxy
socks proxy | socks5 | proxy | proxy free

Justlia From TGR said...

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

Hiphop4Cash said...

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

thanh tung said...

healthtips
healthtips
healthtips
healthtips
healthtips




socks proxy
socks proxy
socks proxy
socks proxy
socks proxy
socks proxy
socks proxy
socks proxy
socks proxy
socks proxy
check socks proxy
socks proxy
socks proxy






funnystory
funnystory
funnystory
funnystory
funnystory




funny pictures
funny pictures
funny pictures
funny pictures
funny pictures
funny pictures






Girl Xinh
Girl Xinh
Girl Xinh
Girl Xinh
Girl Xinh
Girl Xinh
Girl Xinh





cute animal
food news
internet
football news
bank news
marketing
science news
travel vietnamt
real estate vietnam
business news
music news
health news
software
seo news

thanh tung said...

Girl Xinh | Hot Girl | Cute Girl | Sexy Girl |Hot Girl Asian | Hot Girl Xinh
Funny Story | Funny Stories | Funny | lol
Funny Pictures | funny | lol
Girl Xinh | Hot Girl | Cute GirlSexy Girl |Hot Girl Asian | Hot Girl Xinh | lexi belle | ngoc trinh

Đào Quân said...

dich vu lam bao cao tai chinh tai my dinh
dich vu lam bao cao tai chinh tai hai ba trung
dich vu lam bao cao tai chinh tai ba dinh
dich vu lam bao cao tai chinh tai thanh tri
dich vu lam bao cao tai chinh tai hoang mai
dich vu lam bao cao tai chinh tai tay ho
dich vu lam bao cao tai chinh tai dong da
==========
dich vu ke toan thue tai dong da
dich vu ke toan thue tai tay ho
dich vu ke toan thue tai bac ninh
dich vu ke toan thue tai hai ba trung
dich vu ke toan thue tai tu liem
dich vu ke toan thue tai hoang mai
dich vu ke toan thue tai ba dinh
dich vu ke toan thue tai thanh tri
dich vu ke toan thue tai thai binh
cong ty lam dich vu ke toan tai vinh phuc
cong ty dich lam vu ke toan tai hung yen
cong ty dich lam vu ke toan tai phu tho
cong ty lam dich vu ke toan tai hai duong
cong ty lam dich vu ke toan tai hai phong
cong ty lam dich vu ke toan tai bac ninh
dich vu ke toan tai vinh phuc
dich vu ke toan tai hung yen
dich vu ke toan tai hai duong

Đào Quân said...

dich vu ke toan tai tay ho
dich vu ke toan tai ba đinh
dich vu ke toan tai hoang mai
dich vu ke toan tai thanh tri
dich vu ke toan tai dong da
dich vu ke toan tai tu liem
dich vu ke toan tai ha dong
dich vu ke toan tai long bien
dich vu ke toan tai thanh xuan
dich vu ke toan tai hai phong
dich vu ke toan tai bac ninh
dich vu ke toan tai hai ba trung
dich vu ke toan tai dong anh
dich vu ke toan tai gia lam
dich vu ke toan tai ung hoa
dich vu ke toan tai quoc oai
dich vu ke toan tai son tay
dich vu ke toan tai thanh oai
hoc ke toan tong hop
dich vu ke toan thue tron goi
dich vu bao cao tai chinh
dia chi hoc ke toan tong hop
khoa hoc ke toan tong hop
hoc chung chi ke toan
dich vu ke toan thue tai tphcm
lớp học kế toán tổng hợp
lớp học kế toán thực hành

Đào Quân said...

dia chi hoc ke toan tai cau giay
dia chi hoc ke toan tai ha dong
dia chi hoc ke toan tai bac ninh
trung tam dao tao ke toan tai ha dong
trung tam dao tao ke toan tai cầu giấy
trung tam dao tao ke toan tai thanh xuan
trung tam dao tao ke toan tai tphcm
khóa học kế toán tổng hợp tại hải phòng
khóa học kế toán tổng hợp tại tại bắc ninh
khóa học kế toán tổng hợp tại tphcm
khóa học kế toán tổng hợp tại hà nội
trung tam dao tao ke toan tai quan 3
trung tam dao tao ke toan tai binh duong
trung tam dao tao ke toan tai bac ninh
trung tam dao tao ke toan tai hai phong

Đào Quân said...

dich vu ke toan thue tai quan 12
dich vu ke toan thue tai quan 11
dich vu ke toan thue tai quan 10
dich vu ke toan thue tai quan 9
dich vu ke toan thue tai quan 8
dich vu ke toan thue tai quan 7
dich vu ke toan thue tai quan 6
dich vu ke toan thue tai quan 5
dich vu ke toan thue tai quan 4
dich vu ke toan thue tai quan 3
dich vu ke toan thue tai quan 2
dich vu ke toan thue tai quan 1
dich vu ke toan thue tai quan tan phu
dich vu ke toan thue tai quan binh tan
dich vu ke toan thue tai quan phu nhuan
dich vu ke toan thue tai quan tan binh
dich vu ke toan thue tai quan go vap
dich vu ke toan thue tai quan thu duc
dich vu ke toan thue tai quan binh thanh
dich vu ke toan thue tai huyen can gio
dich vu ke toan thue tai huyen nha be
dich vu ke toan thue tai huyen binh chanh
dich vu ke toan thue tai huyen hoc mon
dich vu ke toan thue tai huyen cu chi
dich vu ke toan thue tai huyen can gio