Limiting XML read to 5 records
Posted
by Jean
on Stack Overflow
See other posts from Stack Overflow
or by Jean
Published on 2010-03-23T07:59:00Z
Indexed on
2010/03/23
8:03 UTC
Read the original article
Hit count: 188
Hello,
I have a xml file with 100 records, but I want it to limit it to just 5 records
for ($i=0;$i<=5;$i++) { foreach($xml->entry as $result){
if ($result->updated == $result->published) {
}
}
}
When I put in the above code, it display one record 5 times.
Thanks Jean
© Stack Overflow or respective owner