From 1ff2bc4f3c694b7c76df8e57056c51ca39a23a34 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 20 Jan 2015 18:07:24 +0100 Subject: config module structure completed. Many other fixes. Hidden pw field support. --- inc/util.inc.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'inc/util.inc.php') diff --git a/inc/util.inc.php b/inc/util.inc.php index cce46536..9d0eced9 100644 --- a/inc/util.inc.php +++ b/inc/util.inc.php @@ -216,4 +216,21 @@ SADFACE; return true; } + /** + * Check whether $arrax contains all keys given in $keyList + * @param array $array An array + * @param array $keyList A list of strings which must all be valid keys in $array + * @return boolean + */ + public static function hasAllKeys($array, $keyList) + { + if (!is_array($array)) + return false; + foreach ($keyList as $key) { + if (!isset($array[$key])) + return false; + } + return true; + } + } -- cgit v1.2.3-55-g7522