I have a boolean in php. When I do something like :
sprintf('isTrue=%s', isTrue)
Here isTrue is boolean
I get something like isTrue=1
or isTrue=
. Is there simple way to get isTrue=True
or isTrue=False
I have a boolean in php. When I do something like :
sprintf('isTrue=%s', isTrue)
Here isTrue is boolean
I get something like isTrue=1
or isTrue=
. Is there simple way to get isTrue=True
or isTrue=False
You could use a little utility function like this perhaps
function _bool($b){
return $b ? 'True' : 'False';
}
echo _bool( $var );
echo $isTrue ? 'true' : 'false';
If it isTrue
is a function that return bool value:
echo isTrue() ? 'true' : 'false';
To get with data type:
$isTrue = false;
var_dump($isTrue);