Is there any builtin function for PHP that will take a boolean value and return its integer equivalent? 0 for FALSE, 1 for TRUE? Of course you can easily create a function to do
If you are getting your value in from JSON I.E. Via an AJAX POST, the value will come in as a string (As you have found). A way around this is to compare the true/false string and then cast the bool to an int
$requestBool = $_REQUEST['bool_value']; //This is 'true' or 'false'
$myInt = (int)($requestBool === 'true');
echo $myInt;
//returns: 0 or 1