I post data to a PHP backend using jQuery $.ajax:
$.ajax({
url: "server.php",
method: "post",
data: {
testVariable: true
}
});
On the server side I tried die(gettype($_POST["testVariable"])); which returns string.
I'm trying to save the JSON data posted from Javascript to a MySQL database, but boolean values get quoted which is not what should happen.
What gets inserted is {"testVariable": "true"} and what I need is {"testVariable": true}. How do I accomplish this?