Xml file writing in php

Source: Internet
Author: User
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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.