php force boolean code example
Example 1: php convert to boolean
// (PHP 5 >= 5.5.0, PHP 7)
// boolval — Get the boolean value of a variable
boolval ( mixed $var ) : bool
// Returns the boolean value of var.
Example 2: php boolean to string
$converted_res = $res ? 'true' : 'false';