using simplexml to parse a feed, but I want to grab the date of the oldest item in the feed. Does anyone know how to do it? Thanks
$rss = simplexml_load_file(“http://search.twitter.com/search.atom?lang=en&q=foobar&rpp=100&page=1“);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you simply want to get the last
<entry>element (in document-order) you can use SimpleXMLElement::xpath() and the last() functionhttp://www.w3.org/TR/xpath/ says:
e.g.
[position()=last()]can be shortened to[last()]If the oldest entry is not the last entry in document-order, you’ll need something else.