XStream 1.4.10 发布了。XStream是一个Java对象和XML相互转换的工具,很好很强大,它提供了所有的基础类型、数组、集合等类型直接转换的支持。因此XML常用于数据交换、对象序列化。
下载地址:
Source code (zip)
Source code (tar.gz)
完整更新内容请查看发行首页。
评论删除后,数据将无法恢复
引用来自“eechen”的评论
现在不都用JSON了么?PHP中XML转对象/数组:
$obj = simplexml_load_string($xml);
$arr = json_decode(json_encode($obj) , true);
PHP中数组转XML:
PHP Array2XML Class: 支持解析@attributes和@cdata.
http://www.lalit.org/lab/convert-php-array-to-xml-with-attributes/
$xml = Array2XML::createXML('root_node_name', $php_array);
echo $xml->saveXML();
PHP中XML转对象/数组:
$obj = simplexml_load_string($xml);
$arr = json_decode(json_encode($obj) , true);
PHP中数组转XML:
PHP Array2XML Class: 支持解析@attributes和@cdata.
http://www.lalit.org/lab/convert-php-array-to-xml-with-attributes/
$xml = Array2XML::createXML('root_node_name', $php_array);
echo $xml->saveXML();