Home > Backend Development > PHP Tutorial > php将XML转成数组

php将XML转成数组

WBOY
Release: 2016-06-23 13:44:14
Original
959 people have browsed it

$xmlstring =

乐杨俊
php将XML转成数组
BJ
乐杨俊php相关浅谈!

XML;


$xml = simplexml_load_string($xmlstring);
$data['info'] = json_decode(json_encode($xml),TRUE);
echo "

";  <br> print_r($data);  <br> foreach($data as $values){  <br> foreach($values as $dv){  <br> echo $dv."\n";  <br> }  <br> } 
Copy after login
Related labels:
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