I'm trying to search a JSON to extract some info, but I can't get it done. The JSON looks like this (it's kinda messy):
"d": [{
"__type": "BetFire.Abstractions.Data.SportItem",
"Id": 1,
"Name": "Soccer",
"ExtUrl": "https://s5.sir.sportradar.com/betinaction/en/match/{0}",
"Items": [{
"Id": 384,
"CountryIso": "AUS",
"Name": "AUS Victoria Premier League, Australia",
"MarketsId": -1,
"ParentId": 1,
"MarketNames": null,
"MarketTypeIds": [1,...],
"Items": [{
"Id": 636362298000000000,
"CountryIso": null,
"Name": "2017/07/21",
"MarketsId": 0,
"ParentId": 0,
"MarketNames": null,
"MarketTypeIds": null,
"MarketTabs": null,
"Items": null,
"Events": [{
"EventId": 8937395,
"EventCodeId": 2210,
"ExtraPriceCount": 181,
"EventName": "Oakleigh Cannons vs. Melbourne Knights",
"EventDate": "\/Date(1500633000000)\/",
"Prices": [],
"PrintPrices": null,
"RacingSelections": null,
"RacingDetails": null,
etc..
I have tried something like this (after jsondecode
):
$text = $result['d']['0']['ExtUrl'];
$EventName = $result['d']['Items']['Items']['Events']['EventName'];
echo $EventName;
echo $text;
But I get "{" as result.