Hello,
I am looking to use PHP 4 to read a text file with multiple records in it and then write them to XML.
Can anyone point me in the right direction to do this task?
An example of five records would be very helpul.
Thanks.
Converting Comma Delimited File to XML
Moderator: General Moderators
Opening the file: file_get_contents()
Parsing the data: foreach(), explode()
Working with the data: you should have the elements in an array and from there, place them in whichever XML format you wish line by line via another foreach() loop
Writing the data: fwrite()
The examples and explainations on those pages are very good.
After giving that a try, if you have any issues feel free to revive this thread and ask.
Parsing the data: foreach(), explode()
Working with the data: you should have the elements in an array and from there, place them in whichever XML format you wish line by line via another foreach() loop
Writing the data: fwrite()
The examples and explainations on those pages are very good.
After giving that a try, if you have any issues feel free to revive this thread and ask.