Jump to content

need to read this XML in php please


madcrazy1

Recommended Posts

this is what i have so far:

 

$var=$_POST["fname"];
$xmlDoc = new DOMDocument();
$xmlDoc->loadXML($var);

 

 

I would like to use something similar to this included in it before sql insert:

for($c = 0; $c<$node->length; $c++) 
{	

 

 

1 root, 4 parents and varying childs I believe?

<node>

<building>Number 65</building>

<workers><label>executive</label><names>john</names><label>cook</label><names>terry</names><label>waitress</label><names>jill</names><label>buser</label><names>4564646</names><label>Main</label><number>45564646</number><label>home fax</label><number>45964646</number></workers>


<food><label>breakfast</label><meal>eggs</meal><label>lunch</label><meal>turkey</meal><label>dinner</label><meal>steak</meal></food>


<addresses><label>Home</label><Country>usa</Country><Street>123 mulberry ln </Street><ZIP>57888</ZIP><City>teledo</City><State>Ohio</State><label>location</label><Street>turnpike east 23</Street><City>danbury</City><State>Connecticut</State><Country>USA</Country></addresses>

<building>Number 66</building> etc...

</node>

 

Thank you!

Link to comment
https://forums.phpfreaks.com/topic/247150-need-to-read-this-xml-in-php-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.