Determine if two arrays have at least a single matching element

@param  array $array
@param  bool  $strict
@param  bool  $returnIntersection
@return mixed
544599
public function hasIntersections(array $array, $strict = false, $returnIntersection = false)
    {
        foreach ($this->target as $element) {
            if (in_array($element, $array, $strict)) {
                return $returnIntersection ? $element : true;
            }
        }

        return false;
    }
721092
public static function isAlpha(array $set, $strict = true) {
        return static::every($set, function($value) use ($strict) {
            if (!is_string($value)) {
                return false;
            }

            if ($strict) {
                if (is_string($value) && is_numeric($value)) {
                    return false;
                }
            }

            return true;
        });
    }
443035
static function arraysIntersect(array $array1, array $array2)
    {
        $match = array_intersect($array1, $array2);
        if(is_array($match) && count($match)){
            return true;
        }

        return false;
    }
172295
public function whereIn( $key, array $values, $strict = true )
	{
		return $this->filter( function ( $item ) use ( $key, $values, $strict )
		{
			return in_array( data_get( $item, $key ), $values, $strict );
		} );
	}
34220
public function contains($value, bool $recursive = false, bool $strict = true): bool
    {
        if ($recursive === true) {
            return $this->in_array_recursive($value, $this->getArray(), $strict);
        }

        foreach ($this->getGenerator() as $valueFromArray) {
            if ($strict) {
                if ($value === $valueFromArray) {
                    return true;
                }
            } else {
                /** @noinspection NestedPositiveIfStatementsInspection */
                if ($value == $valueFromArray) {
                    return true;
                }
            }
        }

        return false;
    }
230905
public static function contains($haystack, $needle, $strict = false)
    {
        if ($haystack instanceof \ArrayObject) {
            $haystack = $haystack->getArrayCopy();
        }

        if ($haystack instanceof \SplFixedArray) {
            $haystack = $haystack->toArray();
        }

        \settype($strict, 'bool');

        if (false === $strict) {
            return \in_array($needle, $haystack, false);
        }

        return \in_array($needle, $haystack, true);
    }
915946
public static function searchByColumnValue(array $array, $column, $value, bool $strict = false)
    {
        foreach ($array as $row) {
            if (!$strict && $row[$column] == $value) {
                return $row;
            } elseif ($strict && $row[$column] === $value) {
                return $row;
            }
        }

        return null;
    }
358272
public function pluck($array, $property, &$return = false)
    {
        $return = [];

        if (count($array) > 0) {
            foreach ($array as $item) {
                if (is_array($item)) {
                    $this->pluck($array, $property, $return);
                }

                $return[] = $item->$property;
            }
        }

        return $return;
    }
741024
private function matchVersion(array $array)
    {
        if (!isset($array["version"])) {
            return true;
        }

        if (is_array($array["version"])) {
            foreach ($array["version"] as $version)
            {
                if ($version == $this->getVersion() || $version == "*") {
                    return true;
                }
            }
        } elseif (is_string($array["version"])) {
            if ($array["version"] == $this->getVersion() || $array["version"] == "*") {
                return true;
            }
        }

        return false;
    }
751654
public function findOne (array $array, $callback, $default = null) {
		$filtered = array_filter($array, $callback);
		return count($filtered) ? reset($filtered) : $default;
	}
1310871
public static function getIndexOf(array $array, $element)
    {
        // No elements?
        // Nothing to do
        if (empty($array)) {
            return false;
        }

        foreach ($array as $index => $value) {
            if ($value === $element) {
                return $index;
            }
        }

        return null;
    }
990169
public static function every(array &$arr, $value, $strict = true)
    {
        $filter = function ($v) use ($value, $strict) {
            return $strict ? $v === $value : $v == $value;
        };

        return count(array_filter($arr, $filter)) === count($arr);
    }
469613
public static function where(
        $array,
        $field,
        ?string $operator = null,
        $value = null,
        bool $strict = false,
        bool $keepKey = false
    ): array {
        if (is_string($field)) {
            $operator = $operator === '=' ? '' : $operator;

            $query = [$field . rtrim(' ' . $operator) => $value];
        } elseif (is_array($field)) {
            $query = $field;
        } else {
            throw new \InvalidArgumentException('Where query must br array or string.');
        }

        return ArrayHelper::query($array, $query, $strict, $keepKey);
    }
1074367
public static function first($array, $callback = null, $default = null)
    {
        if (is_null($callback)) {
            return empty($array) ? static::value($default) : reset($array);
        }

        foreach ($array as $key => $value) {
            if (call_user_func($callback, $key, $value)) {
                return $value;
            }
        }

        return static::value($default);
    }
877782
public static function indexOf(array $array, string $value, ?string $key = null)
    {
        foreach ($array as $index => $item) {
            if ($key !== null) {
                if (is_object($item)) {
                    $checkValue = isset($item->{$key}) ? $item->{$key} : null;
                } else {
                    $checkValue = isset($item[$key]) ? $item[$key] : null;
                }
            } else {
                $checkValue = $item;
            }
            if ($checkValue !== null && $checkValue === $value) {
                return $index;
            }
        }
        return -1;
    }
130542
public function where(array $criteria, $strict = false): CollectionInterface
    {
        return array_reduce(
            array_keys($criteria),
            function (GeneratorCollection $collection, $key) use ($criteria, $strict) {
                return $collection->filter(function ($item) use ($key, $criteria, $strict) {
                    if ($strict) {
                        return $item[$key] === $criteria[$key];
                    }

                    return $item[$key] == $criteria[$key];
                });
            },
            $this
        );
    }
1309341
public static function contains($list, $value, $strict = false)
    {
        return static::some($list, function ($item) use ($value, $strict) {
            return $strict ? $item === $value : $item == $value;
        });
    }