dewknight Posted January 11, 2008 Share Posted January 11, 2008 I've been doing a lot of searching and everything I find is either for a big XML file with tons of extra stuff, or not for PHP. I am trying to read one thing from a small XML file. Here is a sample file: http://www.dewknight.com/rank/api.xml The 00 value is what I need. I am going to write it to an image but that's the easy part. What I need is to read this XML file and just get that number. The file will be hosted on a different server, so I will need to get the file via the url. Can anybody help me here? Quote Link to comment https://forums.phpfreaks.com/topic/85487-solved-reading-an-xml-file/ Share on other sites More sharing options...
toplay Posted January 11, 2008 Share Posted January 11, 2008 Look at our tutorials: http://www.phpfreaks.com/tutorial_cat/28/PHP-XML.php Quote Link to comment https://forums.phpfreaks.com/topic/85487-solved-reading-an-xml-file/#findComment-436277 Share on other sites More sharing options...
dewknight Posted January 11, 2008 Author Share Posted January 11, 2008 Thank you, I got it working, though probably not the right way. I will continue to study those tutorials. Quote Link to comment https://forums.phpfreaks.com/topic/85487-solved-reading-an-xml-file/#findComment-436282 Share on other sites More sharing options...
Barand Posted January 11, 2008 Share Posted January 11, 2008 with simplexml <?php $xml = simplexml_load_file('http://www.dewknight.com/rank/api.xml'); echo $xml->site->stat['value']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/85487-solved-reading-an-xml-file/#findComment-436299 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.