Xml file writing in php
"; While ($ row = mysql_fetch_array ($ query) {// echo $ row [imgname]; $ imageurl = ".. /workshow/images /". $ row [imgname]; cutphoto ("$ imageurl", "$ imageurl", 200,113); $ str = $ str."
"; // Echo $ row [imgname];} header (" content-type: text/html; charset = utf-8 "); // specify PHP to use UTF-8 encoding $ xml = simplexml_load_file (".. /workshow/xml/thumbnails. xml "); // read the xml file $ str = $ xml-> asXML (); // standardize $ xml $ fp = fopen (".. /workshow/xml/thumbnails. xml "," w "); // Create an xml file fputs ($ fp, $ str); // write ------- xml file fclose ($ fp);?>
I just want to write an xml file in PHP, but I found that the xml file remains unchanged after each writing, and there is no problem in database reading. what is the problem?
The following is an xml file. the label in the middle is garbled.
Reply to discussion (solution)
Circulating
$ Str = $ str ." But there are
$ Str = $ xml-> asXML ();
Then, will the cached query results not be overwritten?