PaperBag/application/Utils.php

33 lines
686 B
PHP

<?php
class Utils {
public static function filter($input){
if(gettype($input) !== "array"){
$input = trim(htmlentities(strip_tags($input)));
return DB::escape($input);
}
else {
foreach($input as $key => $value){
$input[$key] = filter($value);
}
return $input;
}
}
public static function debug(...$args){
foreach($args as $arg){
echo "<pre>";
if(is_bool($arg)){
var_dump($arg);
}
else {
echo print_r($arg, true);
}
echo "</pre>\n";
}
}
}