public static function endsWith(
        string $haystack,
        string $needle,
        bool $caseSensitive = false
    ): bool
    {
        $test = substr($haystack, -strlen($needle));
        return ($caseSensitive === false)
            ? strcasecmp($test, $needle) === 0
            : strcmp($test, $needle) === 0;
    }
public static function endsWith(
        string $haystack,
        string $needle,
        bool $caseSensitive = false
    ): bool
    {
        $test = substr($haystack, -strlen($needle));
        return ($caseSensitive === false)
            ? strcasecmp($test, $needle) === 0
            : strcmp($test, $needle) === 0;
    }
public static function endsWith ( string $ haystack , string $ needle , bool $ caseSensitive = false ) : bool { $ test = substr ( $ haystack , - strlen ( $ needle ) ) ; return ( $ caseSensitive === false ) ? strcasecmp ( $ test , $ needle ) === 0 : strcmp ( $ test , $ needle ) === 0 ; }
Determine if a string ends with another

@param string $haystack
@param string $needle
@param bool $caseSensitive
@return bool
Determine if a string ends with another