在JSON文件中查找数据并使用PHP返回相应的数据

时间:2018-11-28 23:40:48

标签: php json

我有以下JSON数据,我想查询stock_code ADH并返回其company_name。如何在PHP中做到这一点?

谢谢!

[
  {
    "stock_code": "3PL",
    "company_name": "3P Learning Limited",
    "sector": "Consumer Discretionary"
  },
  {
    "stock_code": "ADH",
    "company_name": "Adairs Limited",
    "sector": "Consumer Discretionary"
  },
  {
    "stock_code": "AAU",
    "company_name": "Adcorp Australia",
    "sector": "Consumer Discretionary"
  }
]

0 个答案:

没有答案