最近想要做一个插件机制,需要用到xml,在解析xml时候需要转换为数组,特意记录一个此种解析方式
xml文件
<?xml version=”1.0″ encoding=”UTF-8″?>
<?php
$xml =simplexml_*本文来源gaodai#ma#com搞@代~码^网+搞代gaodaima码load_string($xmls);
$xmljson= json_encode($xml);
$xml=json_decode($xmljson,true);
dump($xml);