今天在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 | 评论(42) | 引用(0) | 阅读(94895)
shz Email
2022-8-27 23:03
Amazing knowledge and I like to share this kind of information with my friends and hope they like it they why I do  InMotion
Lucky cola
2024-2-7 16:43
Leveling up your gaming arsenal.  Lucky cola
分页: 3/3 第一页 上页 1 2 3 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]