<?php
$json = '{
"$total": 5,
"$page": 1,
"$next": null,
"$back": null,
"$itemsPerPage": 20,
"$items": [{
"id": "763bd4081dc911e797950a57719b2edb",
"displayed_as": "HMRC Reclaimed (HMRC Rec)",
"$path": "\/contacts\/763bd4081dc911e797950a57719b2edb"
},
{
"id": "764ac2e01dc911e797950a57719b2edb",
"displayed_as": "HMRC Payments (HMRC Pay)",
"$path": "\/contacts\/764ac2e01dc911e797950a57719b2edb"
},
{
"id": "062b3f79261811e797950a57719b2edb",
"displayed_as": "The Texaco Garage",
"$path": "\/contacts\/062b3f79261811e797950a57719b2edb"
}
]
}';
$jsonParsed = json_decode($json, true);
var_dump($jsonParsed['$items'][0]['displayed_as']);
- Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.5 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
- string(25) "HMRC Reclaimed (HMRC Rec)"
preferences:
172.31 ms | 404 KiB | 172 Q