Automattic\WooCommerce\Vendor\Pelago\Emogrifier\Utilities

ArrayIntersector::intersectWithpublicWC 1.0

Computes the intersection of $array and the array with which this object was constructed.

Method of the class: ArrayIntersector{}

No Hooks.

Returns

Array. array-key> Returns an array containing all of the values in $array whose values exist in the array with which this object was constructed. Note that keys are preserved, order is maintained, but duplicates are removed.

Usage

$ArrayIntersector = new ArrayIntersector();
$ArrayIntersector->intersectWith( $array ): array;
$array(array) (required)
.

ArrayIntersector::intersectWith() code WC 10.7.0

public function intersectWith(array $array): array
{
    $invertedArray = \array_flip($array);

    $invertedIntersection = \array_intersect_key($invertedArray, $this->invertedArray);

    return \array_flip($invertedIntersection);
}