Curl将xml作为数组返回

时间:2012-06-07 23:20:50

标签: php xml curl google-places-api

我在php中有一个curl程序,它从Google Places API返回xml或JSON。 我了解Google商家信息要求以XML或JSON格式返回请求。 我想知道curl是否可以将它转换成一个阵列给我? 我宁愿不要自己做。

1 个答案:

答案 0 :(得分:3)

$array = json_decode($data, TRUE);