I have an array like this:
array(\"a\" => 2, \"b\" => 4, \"c\" => 2, \"d\" => 5, \"e\" => 6, \"f\" => 2)
Now I want to fi
This should work, but I'm not sure how efficient it is as you probably end up copying a lot of data.
$newArray = array_intersect_key( $fullarray, array_flip(array_keys($fullarray, 2)) );