Automattic\WooCommerce\Vendor\Pelago\Emogrifier\Utilities
ArrayIntersector::intersectWith
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, 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<array-key, array-key>) (required)
- .
ArrayIntersector::intersectWith() ArrayIntersector::intersectWith code WC 11.0.1
public function intersectWith(array $array): array
{
$invertedArray = \array_flip($array);
$invertedIntersection = \array_intersect_key($invertedArray, $this->invertedArray);
return \array_flip($invertedIntersection);
}