I'm sending something like this to PHP using AJAX:
var details = [{name: "thing1", value: true}, {name: "thing2", value: true}, {name: "thing3", value: false}]
$.ajax({
url: 'myphp.php',
type: 'POST',
dataType: 'JSON',
data: {
universalDetails: details,
},
//...etc.
In my PHP, if I include this:
$universalDetails = $_POST["universalDetails"];
var_dump($universalDetails);
All of my value
s are shown as strings in an array...like this:
{ ["name"]=> string(20) "thing1" ["value"]=> string(4) "true" }
What's happening here? How do I preserve these as booleans?