I'm completely unfamiliar with PHP XML DOM, Any help appreciated.
I've been using the site and going through previous answers on this, and anywhere else I could find online, but I can't seem to find a good PHP XML DOM tutorial, my ultimate aim is to take a complex XML and use PHP to upload this into a mysql db. Can anyone recommend a good PHP XML DOM tutorial to do this?
I want to take all the child elements from an XML and put them into an associative array. So in the below 'entry' XML record it would get as far as 'ent_seq' realise there are no sub-nodes, and assign that to a value $array = ($ent_seq[$counter]=>1636730), then the loop would realise the next node is and realise this has subnodes, and choose to assign these subnodes as $array = ($ent_seq[$counter]=>1636730, $keb[$counter]=>通い, $ke_pri[$counter]=>news1); and continue on like that, breaking out the subnodes as appropriate.
<entry>
<ent_seq>1636730</ent_seq>
<k_ele>
<keb>通い</keb>
<ke_pri>news1</ke_pri>
<ke_pri>nf13</ke_pri>
</k_ele>
<r_ele>
<reb>かよい</reb>
<re_pri>news1</re_pri>
<re_pri>nf13</re_pri>
</r_ele>
<sense>
<pos>&n;</pos>
<gloss>coming and going</gloss>
<gloss>commuting</gloss>
</sense>
</entry>
I've not included any of the code I've come up with as its not helpful and it just selects the nodes at the ent_seq level, so for each record its only storing a few pieces of data, and all of the subnodes within the same record.
If anyone could point me in the right direction It would be appreciated.