@param string $haystack
@param string $needle

@return bool
160644
private function endsWith($haystack, $needle)
    {
        $length = strlen($needle);
        if ($length === 0) {
            return true;
        }

        return substr($haystack, -$length) === $needle;
    }
242331
public static function endswith($haystack, $needle) {
    $haylen  = strlen($haystack);
    $needlelen = strlen($needle);
    if ($needlelen > $haylen)
      return false;

    return substr_compare($haystack, $needle, -$needlelen) === 0;
  }
649501
public static function startsWith($haystack, $needle)
    {
        if (strlen($haystack) < strlen($needle)) {
            return false;
        }
        $start = substr($haystack, 0, strlen($needle));

        return $needle === "" || $needle === $start;
    }
76339
public static function contains($haystack, $needles)
    {
        $needles = (array) $needles;

        foreach ($needles as $needle) {
            if ($needle && strpos($haystack, $needle) !== false) {
                return true;
            }
        }

        return false;
    }
842302
private static function arraySearch(string $needle, array $haystack): string
    {
        foreach ($haystack as $key => $value) {
            if ($needle === $value || (is_array($value) && self::arraySearch($needle, $value) !== '')) {
                return $key;
            }
        }

        return '';
    }
564123
public function strpos($haystack, $needle)
    {
        $hstck = '' . $haystack;
        $ndl = '' . $needle;
        if ($hstck === '' || $ndl === '') {
            return false;
        }
        if (static::$nativeSupport['mbstring']) {
            return mb_strpos($hstck, $ndl);
        }

        $pos = strpos($hstck, $ndl);
        if (!$pos) {
            return $pos;
        }
        return count(
            preg_split('//u', substr($hstck, 0, $pos), null, PREG_SPLIT_NO_EMPTY)
        );
    }
1332507
public static function collectionContains($needle, $haystack)
    {
        foreach ($haystack as $value) {
            if ($value === $needle) {
                return true;
            }
        }

        return false;
    }
742125
public static function stringBeginsWith($haystack, $needle)
    {
        if (!empty($needle) && strncmp($haystack, $needle, strlen($needle)) === 0) {
            return true;
        }

        return false;
    }
828865
public function containsFilter($haystack, $needle)
    {
        if (empty($needle)) {
            return $haystack;
        }

        return (strpos($haystack, (string) $needle) !== false);
    }
229443
public static function StartsWith($haystack, $needle)
    {
        $length = static::Length($needle);

        return substr($haystack, 0, $length) === $needle;
    }
982161
public function startswith(string $haystack, string $needle) : bool
    {
        return (substr($haystack, 0, strlen($needle)) === $needle);
    }
1051468
static public function endWith($haystack, $needle)
    {
        if (substr($haystack, -strlen($needle)) === (string) $needle) {
            return true;
        }

        return false;
    }
1215036
protected function in_array($needle, $haystack)
    {
        return count(array_filter($haystack, function ($hay) use ($needle) {
            return $hay === $needle;
        })) > 0;
    }
26891
public function exists($needle, $haystack = null)
    {
        $result = true;
        if ($haystack && $result && $haystack[0] != "00")
            $result = in_array($needle, $haystack);
        return $result;
    }
516855
public static function endsWith($haystack, $needle)
    {
        if (strlen($haystack) < strlen($needle)) {
            return false;
        }
        $end = substr($haystack, strlen($haystack) - strlen($needle), strlen($needle));

        return $needle === "" || $needle === $end;
    }
829816
public static function endsWith($haystack, $needle)
    {
        $hl = strlen($haystack);
        $nl = strlen($needle);
        if(substr($haystack, $hl-$nl, $hl) == $needle)
            return true;

        return false;
    }
324604
public static function contains($haystack, $needle, $ignoreCase = false)
    {
        if ($ignoreCase) {
            $needle = strtolower($needle);
            $haystack = strtolower($haystack);
        }
        $pos = strpos($haystack, $needle);

        return !($pos === false);
    }