$x=new xml();
$x->xml2json();
class xml
{
function xml2json()
{
$xml_object=NULL;
if (file_exists('test.xml'))
{
$xml_object = simplexml_load_file('test.xml');
}
else
{
exit('Failed to open test.xml.');
}
$xml_json=json_encode($xml_object);
echo $xml_json;
}
}

相关文章:

  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-22
  • 2022-12-23
  • 2022-01-09
  • 2021-11-25
  • 2021-11-13
相关资源
相似解决方案