PHP数组返回整个部分

问题描述

嗨,我正在尝试将所有内容都放在[]括号内。我已经尽我所能,但没有运气


    this.gameInstance
        .Quit()
        .then(() => {
            // Do whatever your app needs here
            this.gameInstance = null;
            this.playState$.next(null);
        })
        .catch(() => {
        console.log("Quitting Unity wasn't a success ?");
        });

编辑

我的代码

{
  "Items": [
    {
      "UID": "XXX-XXX","Code": "USD","CurrencyName": "US Dollar","CurrencyRate": 0.71428000,"URI": "https://ar2.api.myob.com/accountright/XXX-XXX/GeneralLedger/Currency/XXX-XXX","RowVersion": "-6496407278109851648"
    }
  ],"NextPageLink": null,"Count": 1
}

解决方法

您需要将JSON转换为数组,然后操纵该数组。假设文本在$json中:

$array=json_decode($json,true);
$result=$array['Items'];

编辑

我忘记了json_decode的第二个参数

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...