public static function stringEndsWith($str, $postfix)
    {
        if(is_array($postfix)){
            foreach($postfix as $p){
                if($p === "" || substr($str, -strlen($p)) === $p){
                    return true;
                }
            }
            return false;
        }
        return $postfix === "" || substr($str, -strlen($postfix)) === $postfix;
    }