I need to save this json as a js file with a date with this format:
1-5-20_us_states.js
The json would then be inserted in the saved file within:
var data = ...json data... ;
I'm trying to follow this answer which it's ok to open the file but how to do the rest then?
Following that answer we should:
$url = "https://covidtracking.com/api/v1/states/daily.json";
$json = file_get_contents($url);
$json_data = json_decode($json, true);