PHP将XML转换成数组/对象

来源:互联网 发布:淘宝购物车打不开 编辑:程序博客网 时间:2024/05/16 15:27
$xml= "<xml><appid>123456</appid></xml>";//XML文件$objectxml = simplexml_load_string($xml);//将文件转换成 对象$xmljson= json_encode($objectxml );//将对象转换个JSON$xmlarray=json_decode($xmljson,true);//将json转换成数组

原创粉丝点击