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;
    }
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;
    }
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 ; }
Does a string end with another string?

@param string $str The string to check
@param string|array $postfix The postfix to check for
@return bool
Does a string end with another string?