php - Choosing Last Node in SimpleXML -


I want to find the property of the last node in the XML file.

The following code is the attribute of the first node of search. Is there any way to find the last node?

  foreach ($ xml-> gig [0] - & gt; Attributes () as the $ id) {} ​​ 

Thanks < / P>

 

> foreach ($ xml- & gt; xpath ("// gig [last ()]") [0] -> property ($ id)) {}


Comments

Popular posts from this blog

Indexing in SQL -

objective c - iPhone and it's wireless area -

multithreading - Do lock objects in Java need to be static? -