src/StringLib.php
/**
    * Checks to see if the string in $haystack ends with $needle.
    * 
    * @param string haystack       - the string to search in.
    * @param string needle         - the string to look for
    * @param bool caseSensitive    - whether to enforce case sensitivity or not 
    *                                (default true)
    * @param bool ignoreWhiteSpace - whether to ignore white space at the ends 
    *                                of the inputs
    * 
    * @return true if haystack begins with the provided string.  False otherwise.
    */
Checks to see if the string in $haystack ends with $needle.

@param string haystack       - the string to search in.
@param string needle         - the string to look for
@param bool caseSensitive    - whether to enforce case sensitivity or not
(default true)
@param bool ignoreWhiteSpace - whether to ignore white space at the ends
of the inputs

@return true if haystack begins with the provided string.  False otherwise.
Checks to see if the string in $haystack ends with $needle . @param string haystack - the string to search in . @param string needle - the string to look for @param bool caseSensitive - whether to enforce case sensitivity or not ( default true ) @param bool ignoreWhiteSpace - whether to ignore white space at the ends of the inputs @return true if haystack begins with the provided string . False otherwise .
public static function endsWith($haystack, 
                                    $needle, 
                                    $caseSensitive = true, 
                                    $ignoreWhiteSpace = false)
    {
        $revHaystack = strrev($haystack);
        $revNeedle   = strrev($needle);
        return self::startsWith(
            $revHaystack, 
            $revNeedle, 
            $caseSensitive, 
            $ignoreWhiteSpace
        );
    }
public static function endsWith ( $ haystack , $ needle , $ caseSensitive = true , $ ignoreWhiteSpace = false ) { $ revHaystack = strrev ( $ haystack ) ; $ revNeedle = strrev ( $ needle ) ; return self :: startsWith ( $ revHaystack , $ revNeedle , $ caseSensitive , $ ignoreWhiteSpace ) ; }
Checks to see if the string in $haystack ends with $needle.
Checks to see if the string in $haystack ends with $needle .