public static function endsWith($haystack, $needles)
    {
        foreach ((array) $needles as $needle) {
            if (substr($haystack, -strlen($needle)) === (string) $needle) {
                return true;
            }
        }

        return false;
    }
public static function endsWith($haystack, $needles)
    {
        foreach ((array) $needles as $needle) {
            if (substr($haystack, -strlen($needle)) === (string) $needle) {
                return true;
            }
        }

        return false;
    }
public static function endsWith ( $ haystack , $ needles ) { foreach ( ( array ) $ needles as $ needle ) { if ( substr ( $ haystack , - strlen ( $ needle ) ) === ( string ) $ needle ) { return true ; } } return false ; }
Determine if a given string ends with a given substring.

@param  string  $haystack
@param  string|array  $needles
@return bool
Determine if a given string ends with a given substring .