@param mixed $needle Searched value.

@return string|bool  Key if found, otherwise false.
178501
public function indexOf($needle)
    {
        foreach (array_values($this->items) as $key => $value) {
            if ($value === $needle) {
                return $key;
            }
        }

        return false;
    }
521334
public function contains($needle, ?string $key = null) : bool
    {
        $value = $this->get($key);

        if (!is_array($value)) {
            throw new InvalidArgumentException(
                'method contains() should be called on array'
            );
        }

        return in_array($needle, $value);
    }
1150447
private function pathContains($needle, $strict = false)
	{
		$needle = trim($needle, ' \\/'); //cleans up the needle in case someone passes in starting or trailing slashes
		$haystack = $this->request->path();
		$existance = strpos($haystack, $needle);
		if ($existance !== false) {
			if ($strict) {
				return $existance === 0 ? true : false;
			} else {
				return true;
			}
		} else {
			return false;
		}
	}
1325767
public function ends_with( $haystack, $needle ) {
		if ( '' === $haystack || '' === $needle ) {
			return false;
		}
		if ( $haystack === $needle ) {
			return true;
		}

		return substr_compare( $haystack, $needle, - strlen( $needle ) ) === 0;
	}
821409
public static function contains($haystack, $needle, $checkAll = false) {
        $contains = false;

        if (is_string($needle)) {
            if (strstr($haystack, $needle)) {
                $contains =  true;
            } else {
                return $contains;
            }
        } else if (is_array($needle) && !$checkAll) {
            foreach ($needle as $check) {
                if (strstr($haystack, $check)) {
                    $contains = true;
                }
            }
        } else if (is_array($needle) && $checkAll) {
            $checked_needles = [];
            foreach ($needle as $check) {
                if (strstr($haystack, $check)) {
                    $checked_needles[] = $check;
                }
            }
            if (count($checked_needles) == count($needle)) {
                $contains = true;
            }
        }

        return $contains;
    }
658158
public function hasKey(string $needle, array $haystack) : bool
    {
        foreach ($haystack as $key => $value) {
            if ($key === $needle) {
                return true;
            }

            if (is_array($value)) {
                if ($x = $this->hasKey($needle, $value)) {
                    return $x;
                }
            }
        }

        return false;
    }
1300664
private function arraySearch( $needle, array $haystack, $valueOffset ): bool {
		if ( array_key_exists( $valueOffset, $haystack ) ) {
			return $this->valueComparer->valuesAreEqual( $needle, $haystack[$valueOffset] );
		}

		return false;
	}
695595
public function find($needle, $set = false)
    {
        if ($needle instanceof AnObjectHandlable) {
            return parent::find($needle);
        }

        $entities = array();

        foreach ($this as $entity) {
            foreach ($needle as $key => $value) {
                $v = AnHelperArray::getValue($entity, $key);
                if (is($value, 'AnDomainEntityAbstract') ||
                     is($value, 'AnDomainEntityProxy')) {
                    $is_equal = $value->eql($v);
                } else {
                    $is_equal = $value == $v;
                }
                if (!$is_equal) {
                    break;
                }
            }
            if ($is_equal) {
                if ($set) {
                    $entities[] = $entity;
                } else {
                    return $entity;
                }
            }
        }

        if (!$set) {
            return;
        }

        return new AnDomainEntityset(new AnConfig(array(
            'data' => $entities,
            'repository' => $this->_repository,
          )));
    }
1303849
public function strpos($needle, $offset = 0)
    {
        $function = static::$functions[(int) static::$useMbstring]['strpos'];

        return $function($this->string, $needle, $offset);
    }
927494
public static function contains(string $haystack, string $needle): bool
    {
        return mb_strpos($haystack, $needle, 0, 'UTF-8') !== false;
    }
272412
public static function endsWith($haystack, $needle)
    {
        return $needle === '' or (($temp = mb_strlen($haystack) - mb_strlen($needle)) >= 0 and mb_strpos($haystack, $needle, $temp) !== false);
    }
1112711
public function arrayMultiSearch($needle, $haystack) {
        foreach ($haystack as $key => $data) {
            if (in_array($needle, $data)) {
                return $key;
            }
        }
        return false;
    }
1125959
public static function search ($needles, array $haystack, & $key = "", array & $stack = [], $strict = false)
		{
			if (!is_array($needles))
			{
				$needles = [$needles];
			}
			if ($strict)
			{
				foreach ($needles as $needle)
				{
					if ($needle === $haystack)
					{
						$stack[] = $key;

						return $stack;
					}
					foreach ($haystack as $k => $hay)
					{
						if ($needle === $hay)
						{
							$key .= "." . $k;
							$stack[] = $key;
						}
						elseif (is_array($hay))
						{
							$tmpKey0  = $key . "." . $k;
							$tmpStack = static::search($needle, $hay, $tmpKey0, $stack, $strict);
							if (count($tmpStack) >= count($stack))
							{
								$stack = $tmpStack;
							}
						}
					}
				}
			}
			else
			{
				foreach ($needles as $needle)
				{
					if ($needle == $haystack)
					{
						$stack[] = $key;

						return $stack;
					}
					foreach ($haystack as $k => $hay)
					{
						if ($needle == $hay)
						{
							$key .= "." . $k;
							$stack[] = $key;
						}
						elseif (is_array($hay))
						{
							$tmpKey0  = $key . "." . $k;
							$tmpStack = static::search($needle, $hay, $tmpKey0, $stack);
							if (count($tmpStack) >= count($stack))
							{
								$stack = $tmpStack;
							}
						}
					}
				}
			}

			return $stack;
		}
1109425
protected function strlikeInArray($needle, array $haystack)
    {
        if (isset($haystack["options"])) {
            $haystack = $haystack["options"];
        }
        foreach ($haystack as $value) {
            if (strpos($value, $needle) !== false) {
                return ($value);
            }
        }
        return (null);
    }
211391
public function has($needle, bool $strict = true): bool
    {
        foreach ($this->values as $value) {
            if ($strict && $value === $needle) {
                return true;
            }

            if ($strict && $value == $needle) {
                return true;
            }
        }

        return false;
    }
1055804
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);
    }
305139
public function lastIndexOf($needle)
    {
        $res = null;
        foreach ($this as $k => $v) {
            if ($v === $needle) {
                $res = $k;
            }
        }
        return $res;
    }