Home > Backend Development > PHP Tutorial > php文件显示xml样式的文件,是怎么完成的

php文件显示xml样式的文件,是怎么完成的

WBOY
Release: 2016-06-23 13:41:44
Original
759 people have browsed it

先说一下,不是外链。
用去哪儿的api,那边给了个例子,http://tuan.cctcct.com/interface/xml/team_list.asp
感觉很奇怪,他asp的怎么显示出来是xml呢?php要如何才能做到这样呢?
这个文件里面有很多list,拿其中一条来说:http://tuan.cctcct.com/interface/xml/team_detail.asp?team_id=1562
后面接有id直接就可以生成了,不需要针对每个去生成一个xml文件,这样就方便多了。
谢谢了。


回复讨论(解决方案)

header('Content-Type:text/xml');header('Charset=utf-8');
Copy after login
Copy after login


然后把xml echo出来即可。

header('Content-Type:text/xml');header('Charset=utf-8');
Copy after login
Copy after login


然后把xml echo出来即可。


谢谢,谢谢啊,解决了。
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template