Possible Duplicate:
How to convert array to SimpleXML
I'm trying to figure out how I can modify a script that does some SQL stuff so that at the end of the script, return either a straight up array or an array encoded in XML format to the client.
What is the best way to do this? I'm pretty sure you can't just return a variable, but it needs to be encoded with something like HTML or XML.
(Also, I need the client to wait until the array has been received in order to avoid storing files on the server).