<?php $allowedKeys = array("a","b","c"); $test = array("a" => "asdf", "c" => "asdf", "d" => "asdf"); $notAllowedKeys = array_diff(array_keys($test), $allowedKeys); if($notAllowedKeys) { print "One or more keys are not allowed"; print_r($notAllowedKeys); }
You have javascript disabled. You will not be able to edit any code.