Write array to xml file [closed]

John-h123

New Member
\[code\]//this is the code that creates the array and the output followswhile ($results_row = mysql_fetch_assoc($results)) { $returned_results[]= array( 'partName'=>$results_row['partName'], 'description'=>$results_row['description'], 'price'=>$results_row['price']//what is contained in the array is as followsArray([partName] => Cooler Master CM Storm Trooper Case[description] => Armored appearance. Nicely placed handle at the top. At the front; ext[price] => 36000)1Array([partName] => Cooler Master eXtreme Power Plus 500-Watt[description] => Power Plus 500-Watt Power Supply,many SATA and peripheral connectors. [price] => 23000)1Array([partName] => Coolmax M-500B ATX Power Supply[description] => The Coolmax M-500B ATX Power Supply has 5 SATA and 5 Peripheral, 8 pin[price] => 20000)\[/code\]I need to write the data contained in the array variable($returned_results[]) to an xml file. After that i will display it in an xml table. But i think i can manage the latter. Could you help me with a code example. Please & Thank you!! the xml file should conatin the array data that looks like this\[code\]<?xml version="1.0" encoding="utf-8"?> <results> <partName>Cooler Master CM Storm Trooper Case</partName> <description>Armored appearance. Nicely placed handle at the top. At the front; ext... </description> <price>36000</price> </results> <results> <partName>Cooler Master eXtreme Power Plus 500-Watt</partName> <description>Power Plus 500-Watt Power Supply,many SATA and peripheral connectors. ... </description> <price>23000</price> </results <results> <partName>Coolmax M-500B ATX Power Supply </partName> <description>The Coolmax M-500B ATX Power Supply has 5 SATA and 5 Peripheral, 8 pin..</description> <price>20000</price> </results>\[/code\]
 
Back
Top