xml转化成php数组

  1. function xml_arr($xml){
  2.     $obj  = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA);
  3.     $json = json_encode($obj);
  4.     $arr  = json_decode($json, true);
  5.     return $arr;
  6. }

你可能感兴趣的:(函数库)