I have jquery code output json data and I need to send this data to to url and fetch using php
Code:
JSON.stringify(showtimes)
Output:
[{"show_id":"1","movie_id":"20","cinema_id":"10","status":"0","times":"00:00"},{"show_id":"2","movie_id":"21","cinema_id":"11","status":"1","times":"01:00"}, ... etc]
I need to send this json data JSON.stringify(showtimes) via ajax to url and fetch json using php.
My ajax code:
$.ajax({
type: 'POST',
url: '/admin/save/',
data: JSON.stringify(showtimes),
success: function(data){}
});
Question:
- Check ajax code is true ?
- How fetch data using PHP ?