nathanmaxsonadil Posted December 5, 2007 Share Posted December 5, 2007 Hi all, I was wondering how I would open and phrase a file in php? for instance I had a file like this <xml><title>not intersting</title><onething>I get this</onething><otherthing>I dont get this</otherthing><onething>I get this again</onething></xml> And I only wanted to get the things in side the onething tag's how would I do that? Quote Link to comment Share on other sites More sharing options...
Wuhtzu Posted December 5, 2007 Share Posted December 5, 2007 http://dk.php.net/xml http://dk2.php.net/simplexml http://www.codehelp.co.uk/php/xmlparse1.php Quote Link to comment Share on other sites More sharing options...
Orio Posted December 5, 2007 Share Posted December 5, 2007 <?php preg_match_all("/<onething>(.*?)<\/onething>/", $file_data, $matches); print_r ($matches[1]); ?> Orio. Quote Link to comment Share on other sites More sharing options...
nathanmaxsonadil Posted December 5, 2007 Author Share Posted December 5, 2007 Thanks guy's Quote Link to comment 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.