I have my json echo working
echo '{"detailsjson":'.json_encode($var).'}';
Now I want to write this to a file on server example output.json
I use the php code
$json_data = {"detailsjson":.json_encode($var).};
file_put_contents('output.json', $json_data);
i don't get the file, but for
file_put_contents("output.json", json_encode($var));
it work. I want to include detailsjson in my json so that i can get
{"detailsjson":[{"Name":"Amateur : Paul Smith",.....
Thanks
echo $json_data;before writing to file