final public static function check_dict(
		array $array, array $keys, bool $trim=false
	) {
		$checked = [];
		foreach ($keys as $key) {
			if (!isset($array[$key]))
				return false;
			$val = $array[$key];
			if ($trim) {
				if (!is_string($val))
					return false;
				$val = trim($val);
				if (!$val)
					return false;
			}
			$checked[$key] = $val;
		}
		return $checked;
	}