I have the following data
{
total: "156",
list: [
{
"nodeRef": "workspace://SpacesStore/e364714d-14bc-4e13-bfff-c1f86a8cbe67",
"id": "e364714d-14bc-4e13-bfff-c1f86a8cbe67",
"name": "Morning Class_Dadi Janki_29-05-12_H_London.mp4",
"mimetype": "video/mp4",
"title" : "Morning Class" ,
"author": "Dadi Janki",
"class_date": "May 29, 2012 12:00:00 AM",
"created": "May 29, 2012 12:32:44 PM",
"size": "97,156,420",
"lang": "h",
"totalViews": "11",
"totalDownloads": "0",
"downloadUrl": "/d/a/workspace/SpacesStore/e364714d-14bc-4e13-bfff-c1f86a8cbe67/Morning%20Class_Dadi%20Janki_29-05-12_H_London.mp4"
}
]
}
When I try to var_dump
it
It gives me null. How do I know whether the data is JSON
encoded or not ?
Edit:
Here's the code
I get the above content by get_contents
to the url
$url = ""; // URL
$contents = file_get_contents($url);
$data = json_decode($contents);
var_dump($data);