My JSON file is like this and I want to read this file in PHP:
{
"data": [
{
"time": 1383458400,
"summary": "Mostly cloudy throughout the day.",
},
{
"time": 1383458400,
"summary": "Mostly cloudy throughout the day.",
}
],
"data": [
{
"time": 1383458400,
"summary": "Mostly cloudy throughout the day.",
},
{
"time": 1383458400,
"summary": "Mostly cloudy throughout the day.",
}
]
}
How can I read this file in PHP? I am using the following to read:
$str = file_get_contents('files/filenameme.json');
$json = json_decode($str, true);