I am trying to send a single PHP variable to a client via json. However, if I generate the string myself and pass it into json_encode, it adds / around the key. I am using:
$threadID = mysqli_insert_id($Thesisdb);
$threadtoJ='{"id":'.$threadID.'}';
echo json_encode($threadtoJ);
I am looking for an output like this: {"id","12"}
echo json_encode(array("id" => 12));["id" => $threadID], where you create an array, which you then encode with the function to JSON.