相关关键词
关于我们
最新文章
PHP输出XML格式数据的方法总结
发布日期:2017-02-08 00:00:00
75
本文实例讲述了PHP输出XML格式数据的方法。分享给大家供大家参考,具体如下:
方法1:
<?php header("Content-type: text/xml"); echo "<?xml version='1.0' encoding='UTF-8'?>"; echo "<users>"; echo "<user>"; echo "<name>"; echo "小小菜鸟"; echo "</name>"; echo "<age>"; echo "24"; echo "</age>"; echo "<sex>"; echo "男"; echo "</sex>"; echo "</user>"; echo "<user>"; echo "<name>"; echo "艳艳"; echo "</name>"; echo "<age>"; echo "23"; echo "</age>"; echo "<sex>"; echo "女"; echo "</sex>"; echo "</user>"; echo "</users>"; ?>