I have a simple script that outputs some JSON. I'm trying to retrieve the JSON contents in a variable with another PHP script, but when I do a var_dump(), I'm getting NULL instead of the JSON data.
Here's the JSON. The only output is: {"ProductID":"1000096","ProductStyleID":"1001029","ProductCategoryID":"1000004"}
json.php
$arr['ProductID'] = "1000096";
$arr['ProductStyleID'] = "1001029";
$arr['ProductCategoryID'] = "1000004";
$json_arr = json_encode($arr);
echo $json_arr;
And here's the cURL script, which right now is outputting NULL:
curl.php
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, "/json.php");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec ($curl);
curl_close ($curl);
var_dump(json_decode($result, true));
How can I retrieve the JSON echoed in the json.php script?