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

php - multilevel menu with multilevel array -

c# - TypeConverter in propertygrid only converts from string, not to -

jQuery UI: Datepicker month format -