How to convert xml into array in php?

前端 未结 9 1548
半阙折子戏
半阙折子戏 2020-11-22 02:54

I want to convert below XML to PHP array. Any suggestions on how I can do this?


   
     
       

        
9条回答
  •  南旧
    南旧 (楼主)
    2020-11-22 03:31

    $array = json_decode(json_encode((array)simplexml_load_string($xml)),true);
    

提交回复
热议问题