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? Link to comment https://forums.phpfreaks.com/topic/80368-solved-phrasing-a-file/ 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 Link to comment https://forums.phpfreaks.com/topic/80368-solved-phrasing-a-file/#findComment-407373 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. Link to comment https://forums.phpfreaks.com/topic/80368-solved-phrasing-a-file/#findComment-407375 Share on other sites More sharing options...
nathanmaxsonadil Posted December 5, 2007 Author Share Posted December 5, 2007 Thanks guy's Link to comment https://forums.phpfreaks.com/topic/80368-solved-phrasing-a-file/#findComment-407385 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.