I'm running php ver 5.4.31. I'm having problems parsing the JSON I'm sending to my php files. My goal is to have an object to use on the other side for db work. I've got logs on the functions before and after to watch all the traffic and here is what I'm getting.
I've been scouring the web and tried a lot of different solutions, I'm adding the closest I've been able to come which generates a string vs an object.
any help is appreciated, I've been banging my head against this for hours now.
JS/Json sent over:
$.get('my.php', {
sc_user: JSON.stringify(obj)
});
console.log: Sent over: {"id":42876678,"kind":"user"
php attempt One:
$plan_B = $_GET['sc_user'];
echo $plan_B;
""{\"id\":42876678,\"kind\":\"user\"
php string generation:
$sc_user = json_decode(stripslashes(json_encode($_GET['sc_user'])));
output: {"id":42876678,"kind":"user"
json_decode:
$sc_user = json_decode($_GET['sc_user']);
output: ""