PHP XML转数组
function xmlToArray($xml)
{
//禁止引用外部xml实体
libxml_disable_entity_loader(true);
v
a
l
u
e
s
=
j
s
o
n
d
e
c
o
d
e
(
j
s
o
n
e
n
c
o
d
e
(
s
i
m
p
l
e
x
m
l
l
o
a
d
s
t
r
i
n
g
(
values = json_decode(json_encode(simplexml_load_string(
values=jsondecode(jsonencode(simplexmlloadstring(xml, ‘SimpleXMLElement’, LIBXML_NOCDATA)), true);
return $values;
}
PHP XML转数组
最新推荐文章于 2022-03-24 11:04:44 发布