compare key and one array

Solutions on MaxInterview for compare key and one array by the best coders in the world

showing results for - "compare key and one array"
Lena
03 Aug 2017
1$array_new = [];
2foreach($array_two as $key)
3{
4    if(array_key_exists($key, $array_one))
5    {
6        $array_new[$key] = $array_one[$key];
7    }
8}
9
similar questions
queries leading to this page
compare key and one array