Search in multidimensional array and return an array path of keys to the searched item
@param string $needle
@param array $haystack
@param string $needleKey
@param boolean $strict
@param array $path
@return mixed
323441
public static function searchRecursive($needle, $haystack, $needleKey = "", $strict = false, $path = [])
    {
        if (!is_array($haystack)) {

            return false;
        }

        foreach ($haystack as $key => $val) {
            if (is_array($val) &&
                $subPath = self::searchRecursive($needle, $val, $needleKey, $strict, $path)
            ) {
                $path = array_merge($path, [$key], $subPath);

                return $path;
            } elseif ((!$strict && ($val == $needle || is_null($needle)) &&
                    $key == (strlen($needleKey) > 0 ? $needleKey : $key)) ||
                ($strict && $val === $needle &&
                    $key == (strlen($needleKey) > 0 ? $needleKey : $key))
            ) {
                $path[] = $key;

                return $path;
            }
        }

        return false;
    }
732437
private function process_inarray($needle, $haystack)
    {
        foreach ($haystack as $stalk) {
            if ($needle === $stalk[0]) {
                return true;
            }
        }

        return false;
    }
1045059
public static function hasAllValuesMultiDimensional(array $haystack, array $needles)
    {
        $return = true;
        foreach ($needles as $needle) {
            if (!in_array($needle, $haystack)) {
                $return = false;
                break;
            }
        }

        return $return;
    }
1083698
public static function EndsWith($haystack, $needle)
    {
        $length = static::Length($needle);

        return $length === 0 || (substr($haystack, -$length) === $needle);
    }
819572
public static function inArrayCaseInsensitive($needle, $haystack)
    {
        if (!$haystack || !is_array($haystack)) {
            return false;
        }
        $lcase = array();
        foreach ($haystack as $key => $val) {
            $lcase[$key] = strtolower($val);
        }
        return in_array(strtolower($needle), $lcase);
    }
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 '';
    }
975820
public static function arraySearchGetValue($needle, array $haystack)
    {
        $lcNeedle = strtolower($needle);

        foreach ($haystack as $value) {
            if ($lcNeedle == strtolower($value)) {
                return $value;
            }
        }

        return null;
    }
1219199
private function strlikeInArray($needle, array $haystack):bool
    {
        foreach ($haystack as $one => $value) {
            if (preg_match("/$value/", $needle) === 1) {
                return (true);
            }
        }
        return (false);
    }
1340777
public static function contains( $haystack, $needles )
    {
        foreach ( ( array ) $needles as $needle )
        {
            if ( '' !== $needle && FALSE !== strpos( $haystack, $needle ) )
            {
                return TRUE;
            }
        }

        return FALSE;
    }
483320
public static function contains($haystack, $needle)
    {
        if (1 === strlen($needle) && !self::isLetterOrDigit($needle)) {
            $needle = '\\' . $needle;
        }

        return (bool)preg_match('|.*' . $needle . '.*|', $haystack);
    }
1305279
public static function getStartsWith($haystack, $needles)
    {
        foreach ((array) $needles as $needle) {
            if ($needle != '' && strpos($haystack, $needle) === 0) {
                return $needle;
            }
        }

        return false;
    }
1191725
public static function within( $haystack, $needle, $offset = 0, $caseSensitive = false )
    {
        if ( false === $caseSensitive )
        {
            //	Case-insensitive
            return false !== stripos( $haystack, $needle, $offset );
        }

        //	Case-sensitive
        return false !== strpos( $haystack, $needle, $offset );
    }
546387
public static function removeVal(&$haystack, $needle, $strict = true)
    {
        $count = 0;
        if (\is_array($haystack)) {
            // PHP 4 doesn't have 3rd array_keys() param -> perform strict check in loop
            $keys = \array_keys($haystack, $needle);
            foreach ($keys as $k) {
                if ($strict && $haystack[$k] !== $needle) {
                    continue;
                }
                unset($haystack[$k]);
                $count++;
            }
        }
        return $count;
    }
794146
public static function hasAllKeys(array $haystack, ...$needles)
    {
        foreach ($needles as $needle) {
            if (array_key_exists($needle, $haystack) === false) {
                return false;
            }
        }

        return true;
    }
749658
public static function recursiveArraySearch($needle, $haystack)
    {
        foreach ($haystack as $key => $value) {
            $current_key = $key;
            if ($needle === $value or (is_array($value) && self::recursiveArraySearch($needle, $value) !== false)) {
                return $current_key;
            }
        }
        return false;
    }
569278
public static function array_ikey_exists($needle, $haystack) {
		if (! \is_array($haystack) || ! \count($haystack)) {
			return false;
		}
		$haystack = \array_keys($haystack);

		return (false !== static::array_isearch($needle, $haystack));
	}
1019286
public static function contains($haystack, $needle, $ignoreCase = false)
    {
        if ($ignoreCase) {
            return stripos($haystack, $needle) !== false;
        } else {
            return strpos($haystack, $needle) !== false;
        }

    }