<?php
$json =
'{
"resultsPage": {
"results": {
"event": [{
"id": 11129128,
"type": "Concert",
"uri": "http://www.songkick.com/concerts/11129128-wild-flag-at-fillmore?utm_source=PARTNER_ID&utm_medium=partner",
"displayName": "Wild Flag at The Fillmore (April 18, 2012)",
"start": {
"time": "20:00:00",
"date": "2012-04-18",
"datetime": "2012-04-18T20:00:00-0800"
},
"performance": [{
"artist": {
"uri": "http://www.songkick.com/artists/29835-wild-flag?utm_source=PARTNER_ID&utm_medium=partner",
"displayName": "Wild Flag",
"id": 29835,
"identifier": []
},
"displayName": "Wild Flag",
"billingIndex": 1,
"id": 21579303,
"billing": "headline"
}],
"location": {
"city": "San Francisco, CA, US",
"lng": -122.4332937,
"lat": 37.7842398
},
"venue": {
"id": 6239,
"displayName": "The Fillmore",
"uri": "http://www.songkick.com/venues/6239-fillmore?utm_source=PARTNER_ID&utm_medium=partner",
"lng": -122.4332937,
"lat": 37.7842398,
"metroArea": {
"uri": "http://www.songkick.com/metro_areas/26330-us-sf-bay-area?utm_source=PARTNER_ID&utm_medium=partner",
"displayName": "SF Bay Area",
"country": {
"displayName": "US"
},
"id": 26330,
"state": {
"displayName": "CA"
}
}
},
"status": "ok",
"popularity": 0.012763
}]
},
"totalEntries": 24,
"perPage": 50,
"page": 1,
"status": "ok"
}
}';
$data = json_decode($json, true);
// Example:
foreach ($data['resultsPage']['results']['event'] as $event) {
echo "id: {$event['id']}\n";
echo "name: {$event['displayName']}\n";
}
echo "\n\n\n";
var_dump($data);
- Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 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.18, 8.3.0 - 8.3.4, 8.3.6
- id: 11129128
name: Wild Flag at The Fillmore (April 18, 2012)
array(1) {
["resultsPage"]=>
array(5) {
["results"]=>
array(1) {
["event"]=>
array(1) {
[0]=>
array(10) {
["id"]=>
int(11129128)
["type"]=>
string(7) "Concert"
["uri"]=>
string(104) "http://www.songkick.com/concerts/11129128-wild-flag-at-fillmore?utm_source=PARTNER_ID&utm_medium=partner"
["displayName"]=>
string(42) "Wild Flag at The Fillmore (April 18, 2012)"
["start"]=>
array(3) {
["time"]=>
string(8) "20:00:00"
["date"]=>
string(10) "2012-04-18"
["datetime"]=>
string(24) "2012-04-18T20:00:00-0800"
}
["performance"]=>
array(1) {
[0]=>
array(5) {
["artist"]=>
array(4) {
["uri"]=>
string(88) "http://www.songkick.com/artists/29835-wild-flag?utm_source=PARTNER_ID&utm_medium=partner"
["displayName"]=>
string(9) "Wild Flag"
["id"]=>
int(29835)
["identifier"]=>
array(0) {
}
}
["displayName"]=>
string(9) "Wild Flag"
["billingIndex"]=>
int(1)
["id"]=>
int(21579303)
["billing"]=>
string(8) "headline"
}
}
["location"]=>
array(3) {
["city"]=>
string(21) "San Francisco, CA, US"
["lng"]=>
float(-122.4332937)
["lat"]=>
float(37.7842398)
}
["venue"]=>
array(6) {
["id"]=>
int(6239)
["displayName"]=>
string(12) "The Fillmore"
["uri"]=>
string(85) "http://www.songkick.com/venues/6239-fillmore?utm_source=PARTNER_ID&utm_medium=partner"
["lng"]=>
float(-122.4332937)
["lat"]=>
float(37.7842398)
["metroArea"]=>
array(5) {
["uri"]=>
string(97) "http://www.songkick.com/metro_areas/26330-us-sf-bay-area?utm_source=PARTNER_ID&utm_medium=partner"
["displayName"]=>
string(11) "SF Bay Area"
["country"]=>
array(1) {
["displayName"]=>
string(2) "US"
}
["id"]=>
int(26330)
["state"]=>
array(1) {
["displayName"]=>
string(2) "CA"
}
}
}
["status"]=>
string(2) "ok"
["popularity"]=>
float(0.012763)
}
}
}
["totalEntries"]=>
int(24)
["perPage"]=>
int(50)
["page"]=>
int(1)
["status"]=>
string(2) "ok"
}
}
- Output for 8.3.5
- Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
id: 11129128
name: Wild Flag at The Fillmore (April 18, 2012)
array(1) {
["resultsPage"]=>
array(5) {
["results"]=>
array(1) {
["event"]=>
array(1) {
[0]=>
array(10) {
["id"]=>
int(11129128)
["type"]=>
string(7) "Concert"
["uri"]=>
string(104) "http://www.songkick.com/concerts/11129128-wild-flag-at-fillmore?utm_source=PARTNER_ID&utm_medium=partner"
["displayName"]=>
string(42) "Wild Flag at The Fillmore (April 18, 2012)"
["start"]=>
array(3) {
["time"]=>
string(8) "20:00:00"
["date"]=>
string(10) "2012-04-18"
["datetime"]=>
string(24) "2012-04-18T20:00:00-0800"
}
["performance"]=>
array(1) {
[0]=>
array(5) {
["artist"]=>
array(4) {
["uri"]=>
string(88) "http://www.songkick.com/artists/29835-wild-flag?utm_source=PARTNER_ID&utm_medium=partner"
["displayName"]=>
string(9) "Wild Flag"
["id"]=>
int(29835)
["identifier"]=>
array(0) {
}
}
["displayName"]=>
string(9) "Wild Flag"
["billingIndex"]=>
int(1)
["id"]=>
int(21579303)
["billing"]=>
string(8) "headline"
}
}
["location"]=>
array(3) {
["city"]=>
string(21) "San Francisco, CA, US"
["lng"]=>
float(-122.4332937)
["lat"]=>
float(37.7842398)
}
["venue"]=>
array(6) {
["id"]=>
int(6239)
["displayName"]=>
string(12) "The Fillmore"
["uri"]=>
string(85) "http://www.songkick.com/venues/6239-fillmore?utm_source=PARTNER_ID&utm_medium=partner"
["lng"]=>
float(-122.4332937)
["lat"]=>
float(37.7842398)
["metroArea"]=>
array(5) {
["uri"]=>
string(97) "http://www.songkick.com/metro_areas/26330-us-sf-bay-area?utm_source=PARTNER_ID&utm_medium=partner"
["displayName"]=>
string(11) "SF Bay Area"
["country"]=>
array(1) {
["displayName"]=>
string(2) "US"
}
["id"]=>
int(26330)
["state"]=>
array(1) {
["displayName"]=>
string(2) "CA"
}
}
}
["status"]=>
string(2) "ok"
["popularity"]=>
float(0.012763)
}
}
}
["totalEntries"]=>
int(24)
["perPage"]=>
int(50)
["page"]=>
int(1)
["status"]=>
string(2) "ok"
}
}
preferences:
204.24 ms | 409 KiB | 291 Q