How is it possible to get the highest existing guid value from an existing xml file (SimpleXml).
xml-structure example:
<xml blabla>
<blog name="">
<post>
<guid>3</guid>
<author></author>
<content>...</content>
</post>
<post>
<guid>1</guid>
<author></author>
<content>...</content>
</post>
</blog>
I tried the following ($xml is an SimpleXml Object)
max($xml->xpath(/blog/post/guid));
but this seems to be no array…
any suggestions? Is there an way to handle it per xpath? My google search wasn’t successful.
You could use array_map(‘intval’… to feed max() with something it “understands”.