- var_dump: documentation ( source)
- json_decode: documentation ( source)
- json_last_error: documentation ( source)
<?php
$json = <<<'EOL'
{
"syndicate-to": [
{
"uid": "https://myfavoritesocialnetwork.example/aaronpk",
"name": "aaronpk on myfavoritesocialnetwork",
"service": {
"name": "My Favorite Social Network",
"url": "https://myfavoritesocialnetwork.example/",
"photo": "https://myfavoritesocialnetwork.example/img/icon.png"
},
"user": {
"name": "aaronpk",
"url": "https://myfavoritesocialnetwork.example/aaronpk",
"photo": "https://myfavoritesocialnetwork.example/aaronpk/photo.jpg"
}
}
]
}
EOL;
$data = json_decode($json, true);
var_dump($data);
var_dump(json_last_error());
var_dump($data['syndicate-to'][0]['uid']);