I’ve got two objects as response from a webservice call. The call is made by a cron job, so I some how have to overwrite the existing data and make the new one available for a front-end call to recieve.
Now my PHP script just echoes the response – but this is not the correct way, right?
How do I store this data?
You should apply json_encode to your objects and save the resulting string in any .txt file then you can access it by ajax calls, the object will be now json string and you can regenerate json object in front end easily by using JSON.parse(json_string_from_txt_file). Hope this helps 🙂