. namespace hoplite\base\filter; function TrimmedString($str) { return trim($str); } function String($str) { $find = array( '<', '>', '"' ); $replace = array( '<', '>', '"' ); return str_replace($find, $replace, $str); } function Int($int) { return intval($int); } function Float($float) { return floatval($float); } function Bool($bool) { $str = strtolower(TrimmedString($bool)); if ($str == 'yes' || $str == 'true') return TRUE; else if ($str == 'no' || $str == 'false') return FALSE; return (bool)$bool; }