How to get values inside <![CDATA[values]] > using php DOM?

前端 未结 5 1927
感动是毒
感动是毒 2020-12-01 06:36

How can i get values inside using php DOM. This is few code from my xml.

     

        
          


        
5条回答
  •  忘掉有多难
    2020-12-01 07:07

    Best and easy way

    $xml = simplexml_load_string($xmlData, 'SimpleXMLElement', LIBXML_NOCDATA);
    $xmlJson = json_encode($xml);
    $xmlArr = json_decode($xmlJson, 1); // Returns associative array
    

提交回复
热议问题