public function endsWith($needle, $caseSensitive = null)
    {
        if ('' === $needle) {
            return true;
        }
        if (null === $caseSensitive) {
            $caseSensitive = false;
        }

        $end = mb_substr($this->string(), -mb_strlen($needle));

        if ($caseSensitive) {
            return $end === $needle;
        }

        return mb_strtolower($end) === mb_strtolower($needle);
    }
public function endsWith($needle, $caseSensitive = null)
    {
        if ('' === $needle) {
            return true;
        }
        if (null === $caseSensitive) {
            $caseSensitive = false;
        }

        $end = mb_substr($this->string(), -mb_strlen($needle));

        if ($caseSensitive) {
            return $end === $needle;
        }

        return mb_strtolower($end) === mb_strtolower($needle);
    }
public function endsWith ( $ needle , $ caseSensitive = null ) { if ( '' === $ needle ) { return true ; } if ( null === $ caseSensitive ) { $ caseSensitive = false ; } $ end = mb_substr ( $ this -> string ( ) , - mb_strlen ( $ needle ) ) ; if ( $ caseSensitive ) { return $ end === $ needle ; } return mb_strtolower ( $ end ) === mb_strtolower ( $ needle ) ; }
Determine if this path ends with a substring.

@param string       $needle        The substring to search for.
@param boolean|null $caseSensitive True if case sensitive.

@return boolean True if this path ends with the substring.
Determine if this path ends with a substring .