This is a simple one but for some reason I can't get it to work. I have a JSON string that I am converting like this...
$results = json_decode($output);
This gives me this...
{
"text": "Test Text",
"truncated": false,
"entities": {
"media": [
{
"media_url": "http:\/\/pbs.twimg.com\/media\/34453543545.jpg",
"media_url_https": "https:\/\/pbs.twimg.com\/media\/34453543545.jpg",
"type": "photo",
"sizes": {
"thumb": {
"w": 150,
"h": 150,
"resize": "crop"
}
}
}
]
}
}
I am trying to get the media_url like this...
$media_url = $results->entities->media_url;
But it is not working, have also tried...
$media_url = $results[entities][media_url];
But still no joy, where am I going wrong?