Title, how does PHP automatically identify third-party RESTful API content and automatically render it into JSON, XML, HTML, serialize, CSV, PHP and other data?In fact, this is not difficult, because the rest API is also based on the HTTP protocol, as long as we follow the protocol, we can do the automation to identify the content of the API, the method is as follows:1, the API server to return the explicit
Phone.csv Zhangsan1,123456789zhangsan2,123456789zhangsan3,123456789Static voidMain (string[] args) { //XML//XML is a file used to store data, such as a CSV fileListstring> list =Newliststring>(); List. ADD (""); string[] lines = File.ReadAllLines ("Phone.csv", Encoding.default); for(inti =0; I ) {list. ADD ("\t"+i.tostring ("00000")+"\ ">"); string[]
1. Problem Description
We deployed a mantisbt bug submission system. After the language is set to Chinese in config_inc.php, the interface is changed to a Chinese interface. However, in the problem column, we export the CSV file and we will find it garbled, the exported Excel file is suffixed with XML. Although it can be opened through the Excel software, the worksheet name is garbled (that is, the footer n
PHPerror_reporting(E_all|e_strict);Ini_set(' Display_errors ',true);Ini_set(' Auto_detect_line_endings ',true);$inputFilename= ' Input.csv ';$outputFilename= ' Output.xml ';//Open csv to read$inputFile=fopen($inputFilename, ' RT ');//Get The headers of the file$headers=Fgetcsv($inputFile);//Create A new DOM document with pretty formatting$doc=NewDomDocument ();$doc->formatoutput =true;//Add A root node to the document$root=$doc->createelement (' Rows
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.