@param $string
@param $ends_with

@return bool
972871
protected function textEndsWith($string, $ends_with)
    {
        $ends_with = trim($ends_with);
        if ($ends_with === '') {
            return false;
        }

        return substr_compare($string, $ends_with, -strlen($ends_with), strlen($ends_with)) === 0;
    }
1076549
public function getStringsBetween($string, $start, $end)
    {
        $lastPos   = 0;
        $positions = array();

        while (($lastPos = strpos($string, $start, $lastPos)) !== false) {
            $positions[] = $lastPos;
            $lastPos     += strlen($start);
        }
        $lastPos      = 0;
        $positionsEnd = array();
        while (($lastPos      = strpos($string, $end, $lastPos)) !== false) {
            $positionsEnd[] = $lastPos;
            $lastPos        += strlen($end);
        }
        $return = [];
        foreach ($positions as $index => $position) {
            $return[] = str_replace([$start, $end], '', substr($string, $position, $positionsEnd[$index] - $position));
        }
        return $return;
    }
1290779
public boolean endsWith(String str)
    {
        /* Let's just play this safe; should seldom if ever happen...
         * and because of that, can be sub-optimal, performancewise, to
         * alternatives.
         */
        if (mInputStart >= 0) {
            unshare(16);
        }

        int segIndex = (mSegments == null) ? 0 : mSegments.size();
        int inIndex = str.length() - 1;
        char[] buf = mCurrentSegment;
        int bufIndex = mCurrentSize-1;

        while (inIndex >= 0) {
            if (str.charAt(inIndex) != buf[bufIndex]) {
                return false;
            }
            if (--inIndex == 0) {
                break;
            }
            if (--bufIndex < 0) {
                if (--segIndex < 0) { // no more data?
                    return false;
                }
                buf = mSegments.get(segIndex);
                bufIndex = buf.length-1;
            }
        }

        return true;
    }
520599
public boolean endsWith(String str, String suffix) {
        return (str == null || suffix == null) ? (str == suffix) :
            str.endsWith(suffix);
    }
234733
static function endsWith($haystack, $needles, $strict = true)
    {
        // 不区分大小写的情况下 全部转为小写
        if (!$strict) $haystack = mb_strtolower($haystack);

        // 支持以数组方式传入 needles 检查多个字符串
        foreach ((array)$needles as $needle) {
            if (!$strict) $needle = mb_strtolower($needle);
            if ((string)$needle === mb_substr($haystack, -mb_strlen($needle))) {
                return true;
            }
        }
        return false;
    }
567478
public BooleanExpression endsWith(Expression<String> str) {
        return Expressions.booleanOperation(Ops.ENDS_WITH, mixin, str);
    }
496034
protected function hasExpressions(string $string): bool
    {
        foreach (self::STOPS as $symbol) {
            if (strpos($string, $symbol) !== false) {
                return true;
            }
        }

        return false;
    }
653985
public static function endsWith(?string $what, ?string $where): bool
    {
        // check is not empty string
        if (self::likeEmpty($what) || self::likeEmpty($where)) {
            return false;
        }

        $suffix = self::sub($where, -self::length($what));
        return $suffix === $what;
    }
417654
public static function stringEndsWith($haystack, $needle)
    {
        if (substr($haystack, - strlen($needle)) === $needle) {
            return true;
        }

        return false;
    }
414893
public static function ends_with( $str, $full_string, $case_sensitive = false ){
		$offset = strlen( $full_string ) - strlen( $str );
		if( strlen( $str ) == 0 || strlen( $full_string ) == 0 || $offset >= strlen( $full_string ) ){
			return false;
		}
		return substr_compare( $full_string, $str, $offset, strlen( $str ), ! $case_sensitive ) === 0;
	}
520755
public static function ensure_end_with($string, $trailing_string)
    {
        if (StringTool :: end_with($string, $trailing_string))
        {
            return $string;
        }
        else
        {
            return $string . $trailing_string;
        }
    }
921747
static function endsWith($string, $endsWith, $caseSensitive = true) {
		$len = self::strlen($endsWith);
		if ($caseSensitive) return self::substr($string, -1 * $len) == $endsWith;
		return self::strtolower(self::substr($string, -1 * $len)) == self::strtolower($endsWith);
	}
541393
private function findAllTextBetween($beginning, $end, $string) {
    $beginningPos = strpos($string, $beginning);
    $endPos = strpos($string, $end);
    if ($beginningPos === false || $endPos === false) {
      return '';
    }

    $textToDelete = substr($string, $beginningPos, ($endPos + strlen($end)) - $beginningPos);

    return $textToDelete;
  }
929985
public static function ends_with( $haystack, $needle ) {
        return ( substr( $haystack, strlen( $haystack ) - strlen( $needle ) ) == $needle );
    }
194103
private function endsWith($str, $sub)
    {
        return substr($str, strlen($str) - strlen($sub)) === $sub;
    }
725554
public static function endsWith(string $paths, string $needle) : bool
    {
        if ($paths == '') {
            return false;
        }
        if ($needle == '') {
            return false;
        }

        // search forward starting from end minus needle length characters
        // see: http://stackoverflow.com/questions/834303/startswith-and-endswith-functions-in-php
        return (($temp = strlen($paths) - strlen($needle)) >= 0 && strpos($paths, $needle, $temp) !== false);
    }
551642
public function endWithFunction($needle, $haystack = [])
    {
        if (in_array($needle, $haystack)) {
            return true;
        } else {
            foreach ($haystack as $item) {
                $length = strlen($needle);
                if (substr($haystack, -$length) === $needle) {
                    return true;
                }
            }
        }

        return false;
    }