How to include 1 piece of an XML tree in a php file



I am trying to make a php file to display just one item from an XML file. The XML file is at http://ift.tt/1E7Pah6


The piece of info I am after is:



<SHOUTCASTSERVER><STREAMSTATS><CURRENTLISTENERS>15</CURRENTLISTENERS></STREAMSTATS></SHOUTCASTSERVER>


But I just want the php file to output the number 15 (or whatever it might be) so I can do a php include on a webpage.


I have been trying to use SimpleXML but I cannot seem to get it to work. I'd appreciate any help!


Regards, John.


No comments:

Post a Comment