To anyone like me who came here looking for a way to turn any value into a 0/1 that will fit into a MySQL boolean (tinyint) field:
<?php
$tinyint = (int) filter_var($valToCheck, FILTER_VALIDATE_BOOLEAN);
?>
tinyint will be 0 (zero) for values like string "false", boolean false, int 0
tinyint will be 1 for values like string "true", boolean true, int 1
Useful if you are accepting data that might be from a language like Javascript that sends string "false" for a boolean false.