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);

    }
<?php         $names = array_map('strtolower', (array) $names);



        return count($names) === count(array_intersect($names, array_map('strtolower', $this->listTableNames())));

    }
<?php         if ($selected = $this->resource->selectedQueryColumns()) {

            $diff = array_intersect($selected, $fields);

            $fields = empty($diff) ? $fields : $diff;

        }
<?php             $model = $this->builder->getModel();

            $schema = $model->getConnection()->getSchemaBuilder()->getColumnListing($model->getTable());

            $selected = array_intersect($schema, $columns);

        }



        return empty($selected) ? ['*'] : $selected;
<?php             }



            if (!empty($packages)) {

                $packages = array_intersect($packages, $requires);

            } else {

                $packages = $requires;

            }
<?php             $isDownloadsModifyingPlugin = $package->getType() === 'composer-plugin' && ($extra = $package->getExtra()) && isset($extra['plugin-modifies-downloads']) && $extra['plugin-modifies-downloads'] === true;




            if ($isDownloadsModifyingPlugin || count(array_intersect($package->getNames(), $dlModifyingPluginRequires))) {


                $requires = array_filter(array_keys($package->getRequires()), function ($req) {

                    return !PlatformRepository::isPlatformPackage($req);
<?php             $isPlugin = $package->getType() === 'composer-plugin' || $package->getType() === 'composer-installer';




            if ($isPlugin || count(array_intersect($package->getNames(), $pluginRequires))) {


                $requires = array_filter(array_keys($package->getRequires()), function ($req) {

                    return !PlatformRepository::isPlatformPackage($req);
<?php         $relevantContent = array();



        foreach (array_intersect($relevantKeys, array_keys($content)) as $key) {

            $relevantContent[$key] = $content[$key];

        }

        if (isset($content['config']['platform'])) {