Home > Backend Development > PHP Tutorial > PHP将解析xml变为数组方法

PHP将解析xml变为数组方法

WBOY
Release: 2016-06-23 13:18:48
Original
939 people have browsed it

最近想要做一个插件机制,需要用到xml,在解析xml时候需要转换为数组,特意记录一个此种解析方式

xml文件

$xml =simplexml_load_string($xmls);

$xmljson= json_encode($xml);

$xml=json_decode($xmljson,true);

dump($xml);

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template