Jump to content

Help with arrays please???


tommyda

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.