intersect

container intersect(container1, container2)

Returns a copy of container1 containing only the elements/keys also present in container2.

Parameters

  1. container1 — first container, either array or dictionary.
  2. container2 — second container of the same type as the first.

Returns