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**[email protected]</contact> <contact type="1">garret**[email protected]</contact> <contact type="1">amym**[email protected]</contact> </contactlist> </service> </messenger> 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 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. Link to comment https://forums.phpfreaks.com/topic/131965-help-with-arrays-please/#findComment-685705 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.