エコー私は以下のコードは動作しませんPHP JSONエンコード値
{
"expand":"names",
"startAt":0,
"maxResults":50,
"total":1,
"issues":[
{
"expand":"example",
"id":"129018",
"self":"https://example.com",
"key":"914",
"fields":{
"summary":"Hello there"
}
}
]
}
「要約」の値をエコーする必要があります。
$array_result = json_decode($run_curl, true);
$title = $array_result['issues']['fields']['summary];
私はここで間違って何をしているのですか?私はそれがシンプルで分かりやすいとかなり確信しています。
を、あなたはそれをインデックスを与えるべきではないのですか?多分、 '$ title = $ array_result ['issues'] [0] ['fields'] ['summary];' – avip
これはjson_decodeの後のオブジェクトなので、オブジェクトのようにアクセスする必要があります。 –
@FrayneKonok彼は 'json_decode'の2番目のパラメータとして真実を渡しました – avip