Json Encode or Serialize an XML

后端 未结 5 1277
-上瘾入骨i
-上瘾入骨i 2020-12-22 06:01

I have some xml, this is a simple version of it.



  item one
  item two         


        
5条回答
  •  清酒与你
    2020-12-22 06:27

    $xml = new SimpleXMLElement($xmlString);
    

    $xml is now an object. To get the value of an attribute:

    $xml->something['id'];
    

    Where 'id' is the name of the attribute.

提交回复
热议问题