tommyda Posted November 8, 2008 Share Posted November 8, 2008 How do I separate the output so I can insert each individual email address into a database? <?php if (file_exists('test.xml')) { $xml = simplexml_load_file('test.xml'); } //echo $xml->asXML(); - displays all email addresses $output = $xml->asXML(); $names = array($output); //echo $names; - displays all email addresses // How do I insert each individual email address into a db>? ?> XML <?xml version="1.0"?> <messenger> <service name=".NET Messenger Service"> <contactlist> <contact type="1">dan**20@hotmail.com</contact> <contact type="1">garret**fc@hotmail.co.uk</contact> <contact type="1">amym**son_x@live.co.uk</contact> </contactlist> </service> </messenger> Quote Link to comment https://forums.phpfreaks.com/topic/131965-help-with-arrays-please/ Share on other sites More sharing options...
DeanWhitehouse Posted November 8, 2008 Share Posted November 8, 2008 Why capitals? And i believe you want explode(); http://uk2.php.net/explode With it you will need the emails separated by something, e.g. a comma Quote Link to comment https://forums.phpfreaks.com/topic/131965-help-with-arrays-please/#findComment-685698 Share on other sites More sharing options...
tommyda Posted November 8, 2008 Author Share Posted November 8, 2008 Why capitals? Sorry, I know its really annoying I have changed it. Quote Link to comment https://forums.phpfreaks.com/topic/131965-help-with-arrays-please/#findComment-685705 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.