赣南脐橙

keybr

佰草伐

导航

通过 PHP 生成 XML

如需使用 PHP 在服务器上生成 XML 响应,请使用下面的代码:

<?php
header("Content-type:text/xml");
echo "<?xml version='1.0' encoding='ISO-8859-1'?>";
echo "<note>";
echo "<from>John</from>";
echo "<to>George</to>";
echo "<message>Don't forget the meeting!</message>";
echo "</note>";
?>

请注意,响应头部的内容类型必须设置为 "text/xml"。

posted on 2019-08-20 16:30  佰草伐  阅读(434)  评论(0)    收藏  举报

keybr

php基础知识

Wood Furniture