nepaluz
asked on
Write xml from string
I have what is routine to me in VB but have not been able to accomplish in PHP.
Can someone please give me some code suggestion on how to write the following lines of string to an XML file as per below?
The strings:
Pat,Rafter,30,Aussie
Boris,Becker,17,German
Paul,Raddy,28,Russian
The XML
<doc>
<Record>
<fname>Pat</fname>
<lname>Rafter</lname>
<magicno>30</magicno>
<village>Aussie</village>
</Record>
<Record>
<fname>Boris</fname>
<lname>Becker</lname>
<magicno>17</magicno>
<village>German</village>
</Record>
<Record>
<fname>Paul</fname>
<lname>Raddy</lname>
<magicno>28</magicno>
<village>Russian</village>
</Record>
</doc>
Can someone please give me some code suggestion on how to write the following lines of string to an XML file as per below?
The strings:
Pat,Rafter,30,Aussie
Boris,Becker,17,German
Paul,Raddy,28,Russian
The XML
<doc>
<Record>
<fname>Pat</fname>
<lname>Rafter</lname>
<magicno>30</magicno>
<village>Aussie</village>
</Record>
<Record>
<fname>Boris</fname>
<lname>Becker</lname>
<magicno>17</magicno>
<village>German</village>
</Record>
<Record>
<fname>Paul</fname>
<lname>Raddy</lname>
<magicno>28</magicno>
<village>Russian</village>
</Record>
</doc>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
anyway, after a long evening, I managed to get some code from Daniweb. Thanks all who contributed.