Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 1292 → Rev 1294

/trunk/includes/functions.inc.php
676,3 → 676,21
$res .= '</ul>';
return $res;
}
 
/**
* @param mixed $mixed
* @return bool
*/
function oidplus_is_true($mixed): bool {
if (is_null($mixed)) {
return false;
} else if (is_string($mixed)) {
return (strtolower($mixed) == 'true') || ($mixed == '1') || (strtolower($mixed) == 'y') || (strtolower($mixed) == 't');
} else if (is_bool($mixed)) {
return $mixed;
} else if (is_numeric($mixed)) {
return $mixed != 0;
} else {
return $mixed ? true : false; // let PHP decide...
}
}