array_intersect

Supported Versions: PHP 4 >= 4.0.1, PHP 5, PHP 7, PHP 8
Computes the intersection of arrays
<?php array_intersect(array $array, array ...$arrays): array
<?php     public function intersect($items)

    {

        return new static(array_intersect($this->items, $this->getArrayableItems($items)));

    }
<?php     public function availableDrivers()

    {

        return array_intersect(

            $this->supportedDrivers(),

            str_replace('dblib', 'sqlsrv', PDO::getAvailableDrivers())

        );

    }
<?php         } elseif (count($relations) === 1) {

            return reset($relations);

        } else {

            return array_intersect(...array_values($relations));

        }

    }
<?php         $detach = array_values(array_intersect(

            $this->newPivotQuery()->pluck($this->relatedPivotKey)->all(),

            array_keys($records)

        ));



        if (count($detach) > 0) {

            $this->detach($detach, false);
<?php         foreach ($this->getTables() as $table) {

            $qualifiedName = $table['schema'].'.'.$table['name'];



            if (empty(array_intersect($this->grammar->escapeNames([$table['name'], $qualifiedName]), $excludedTables))

                && in_array($this->grammar->escapeNames([$table['schema']])[0], $schemas)) {

                $tables[] = $qualifiedName;

            }
<?php             }



            if (isset($options['trashed']) &&

                in_array($m, ! empty($options['trashed']) ? $options['trashed'] : array_intersect($resourceMethods, ['show', 'edit', 'update']))) {

                $route->withTrashed();

            }
<?php         $methods = $defaults;



        if (isset($options['only'])) {

            $methods = array_intersect($methods, (array) $options['only']);

        }



        if (isset($options['except'])) {
<?php         return $this->hasRule($attribute, $this->implicitRules) &&

               isset($this->failedRules[$cleanedAttribute]) &&

               array_intersect(array_keys($this->failedRules[$cleanedAttribute]), $this->implicitRules);

    }