Say we have a radio button "isActive" in a form that returns either true or false. We then want to work with that radio button in conditions like so:
if ($isActive) {
// do stuff
}
Bu the value returned from the form is a string, so we would have to use something like:
if ($isActive == 'true') {
// do stuff
}
Is there a way to cast this value to a bool without doing something like this?:
if ($isActive == 'true') {
$isActive = true;
} else {
$isActive = false;
}