protected function all($_sql) { $_db = DB::getDB(); $_result = $_db->query($_sql); $_html = array(); while (!!($_objects = $_result->fetch_object())) { $_html[] = $_objects; } DB::unDB($_result, $_db); return Tool::htmlString($_html); }
public static function htmlString($_date) { if (is_array($_date)) { foreach ($_date as $_key => $_value) { $_string[$_key] = Tool::htmlString($_value); //递归 } } elseif (is_object($_date)) { foreach ($_date as $_key => $_value) { $_string->{$_key} = Tool::htmlString($_value); //递归 } } else { $_string = htmlspecialchars($_date); } return $_string; }