今天在PHP4环境下重新写一个接口程序,需要大量分析解析XML,PHP的xml_parse_into_struct()函数不能直接生成便于使用的数组,而SimpleXML扩展在PHP5中才支持,于是逛逛搜索引擎,在老外的网站上找到了一个不错的PHP XML操作类。

一、用法举例:
1、将XML文件解释成便于使用的数组:


data.xml文件:


利用该XML操作类生成的对应数组(汉字编码:UTF-8):


2、将数组转换成XML文件:


二、PHP XML操作类源代码:


技术大类 » PHP/JS/Shell | 评论(28) | 引用(0) | 阅读(77363)
cxf0401
2012-6-11 10:39
Welcome to our sunglasses wholesaleonline sales shop, where you can always buy the most affordable price to a your favorite discount designer sunglasses.discount sunglassesart and technology with a smooth edge of attitude for your active lifestyle. Engineered for those who understand that style is something define for yourself.
coach88888888 Email
2012-8-13 17:28
Coach Factory Outlet offer excellent, elegant coach products in order to generate room for your new collections.They're purchased more quickly that you may at any time imagine.Most significantly, the coach designer purses of Coach Factory Online industry won't deteriorate your individual fashions at all. Rather they would immediately change your overall looks marvelously.I find it all very odd But this is no different than Coach Outlet Online any other company that has an outlet presence and really doesn’Coach Outlet Store t explain it to the customer.By the fashion, novel appearance, sophisticated technology, superior quality, Coach Outlet won domestic and international customers, their products exported to the Middle East, Southeast Asia and other regions.
GQWE
2013-1-29 17:32
买轴承就到:www.jkzhoucheng.cn
aa Email Homepage
2013-4-19 21:28
http://www.cloudstec.com 外贸建站
bb Email Homepage
2013-4-19 21:29
云轩网络外贸外包,网站开发。 www.cloudstec.com 有需要联系我。 QQ1305929430
bb Email Homepage
2013-4-19 21:29
外贸建站开发,外贸。门户网开发。[url=http://www.cloudstec.com][/url]
jack
2015-1-8 17:36
解决了实际业务中的一个小问题 十分感谢分享
分页: 2/2 第一页 上页 1 2 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]