Communities for your favorite technologies. Explore all Collectives
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
With array_intersect_keyarray_intersect_key and array_fliparray_flip:
array_intersect_key
array_flip
var_dump(array_intersect_key($my_array, array_flip($allowed))); array(1) { ["foo"]=> int(1) }
With array_intersect_key and array_flip:
array_intersect_key is pretty much self explanatory and array_flip flips the keys with the values.
With array_intersect_keyarray_intersect_key and array_flip array_flip:
array_intersect_keyarray_intersect_key is pretty much self explanatory and array_fliparray_flip flips the keys with the values.
With array_intersect_key and array_flip :