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

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -