php, extract data from a non-standard xml document
- by Michael
I have some kind xml content I need to extract the information and store it into database
<xml file="136000000-136100000">
<Id>136000000</Id>
<Name>Sem Serxy</Na me>
<Email>[email protected]</Email>
<DateRegistration>10/13/2010 1:49:30 AM</DateRegistration>
</xml>
<xml file="136000000-136100000">
<Id>136000001</Id>
<Name>God Deckor</Name>
<Email>[email protected]</Email>
If I try simple xml load is not working as the document doesn't seem to be valid xml.
I can use regex to extract the info with preg_match_all but I feel this is not the right way as the data is already well structured. Any other method ?