你可以循环一下,用新数组['key']=旧对象->key。也可以这样:$array =json_decode(json_encode(simplexml_load_string($xmlString)),TRUE);