I have been trying to retrieve JSON data from my php file.Its giving me a hard time.This is my code
Code in my VIEW:
var productDetails = {\'id\':ISB
I had the same problem but I found the solution.
This is the Json that I am sending [{"name":"JOSE ANGEL", "lastname":"Ramirez"}]
[{"name":"JOSE ANGEL", "lastname":"Ramirez"}]
$data = json_decode(file_get_contents('php://input'), true); echo json_encode($data);
This code was tested and the result is [{"name":"JOSE ANGEL","lastname":"Ramirez"}]
[{"name":"JOSE ANGEL","lastname":"Ramirez"}]