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
Post a Comment