Hi, I'm using a function to convert an array to a string (supposedly), and then write that to an external (XML) file. But for some reason, while the string displays correctly within the PHP file, it is not written to the external file. No errors come up. Original array (shortened for viewing purposes): [code] Array ( [picture] => Array ( [0] => Array ( [image] => images/image1.jpg [thumb] => images/th_image1.jpg [title] => Image 1 Title [description] => image 1 description ) [1] => Array ( [image] => images/th_image2.jpg [thumb] => images/th_image2.jpg [title] => Image 2 Title [description] => image 2 description ) ) ) [/code] Convert array to XML string: [code] function array2xml($array) { print "<?xml version='1.0'?>\n\t<gallery>"; while (list ($num, $tmp) = each ($array)) { print "\n\t\t<picture>"; while (list ($key, $val) = each ($tmp)) { print "\n\t\t\t<$key>$val</$key>"; } print "\n\t\t</picture>"; } print "\n</gallery>"; } [/code] Displayed in PHP file: [code] <?xml version='1.0'?> <gallery> <picture> <image>images/image1.jpg</image> <thumb>images/th_image1.jpg</thumb> <title>Image 1 Title</title> <description>image 1 description</description> </picture> <picture> <image>images/th_image2.jpg</image> <thumb>images/th_image2.jpg</thumb> <title>Image 2 Title</title> <description>image 2 description</description> </picture> </gallery> [/code] Write data to a file: [code] $xmlstr = array2xml($arr["picture"]); $fp = fopen ('temp.xml', 'w'); //While the data is not written, the temp file is created successfully. $write = fputs($fp,$xmlstr); fclose ($fp); [/code] Sorry for the very long post. Thanks for your help! -Brandy