Answers for "compare key and one array"

PHP
0

compare key and one array

$array_new = [];
foreach($array_two as $key)
{
    if(array_key_exists($key, $array_one))
    {
        $array_new[$key] = $array_one[$key];
    }
}
Posted by: Guest on February-05-2021

Code answers related to "compare key and one array"

Browse Popular Code Answers by Language