PHP将数据列表转换为数组

时间:2014-05-10 20:47:09

标签: php arrays

所以我有以下链接,其中包含大量数据(很多)。 http://www.gw2spidy.com/api/v0.9/json/all-items/all

数据是〜50,000套数据的列表,以逗号分隔 无论如何,我可以将大约50,000个数据条目转换为数组吗?

以下是一个数据条目供参考。

{
  "data_id":2,
  "name":"Assassin Pill",
  "rarity":1,
  "restriction_level":0,
  "img":"https:\/\/render.guildwars2.com\/file\/ED903431B97968C79AEC7FB21535FC015DBB0BBA\/60981.png",
  "type_id":3,
  "sub_type_id":1,
  "price_last_changed":"2014-05-10 20:00:13 UTC",
  "max_offer_unit_price":0,
  "min_sale_unit_price":0,
  "offer_availability":0,
  "sale_availability":0,
  "sale_price_change_last_hour":0,
  "offer_price_change_last_hour":0
}

1 个答案:

答案 0 :(得分:1)

是JSON数据,使用

$yourarray = json_decode(file_get_contents('http://www.gw2spidy.com/api/v0.9/json/all-items/all'),true);

将它们转换为数组。

相关问题