<?php
$xml = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<books>
</books>
EOF;
echo $json = json_encode(simplexml_load_string($xml));
?>
将xml转换成json最简单的办法
最新推荐文章于 2023-11-22 11:48:12 发布
<?php
$xml = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<books>
</books>
EOF;
echo $json = json_encode(simplexml_load_string($xml));
?>