It seems to me, that the easiest method by far would be this:
$required = array('a','b','c','d');$values = array('a' => '1','b' => '2');$missing = array_diff_key(array_flip($required), $values);
Prints:
Array( [c] => 2 [d] => 3)
This also allows to check which keys are missing exactly. This might be useful for error handling.