private function filterArray($arrData, $arrFilters) {
		// Normalize the filter array (['filter' => FILTER, ...])
		foreach ($arrFilters as $key => &$F) {
			if (is_int($F))
				$F = array('filter' => $F);

			elseif (!isset($F['filter'])) {
				unset($arrFilters[$key]);
				continue;

			} elseif (is_string($F['filter'])) {
				try {
					$intF = @constant($F['filter']);
				} catch (\Exception $e) {
					continue;
				}
				if ( $intF )
					$F['filter'] = $intF;
				else {
					continue;

				}
			} elseif (isset($F['required'])) {
				if (!$F['required'] && (string)$arrData[$key] == '') {
					unset($arrFilters[$key]);
					continue;
				}
			}

			$F['value'] = isset($arrData[$key]) ? $arrData[$key] : null;
			if (!isset($F['field']))
				$F['field'] = $key;
		}

		$arrCallbacks = array();
		$arrValidators = array();

		// Remove callback functions from the filter array and allocate them to the callback array
		foreach ($arrFilters as $key => $filter) {
			if (isset($this->filters[$filter['filter']])) {
				$arrValidators[$key] = $filter + $this->filters[$filter['filter']];
				$arrValidators[$key]['filter'] = $this->filters[$filter['filter']]['filter'];
			} elseif (isset($this->callbacks[$filter['filter']]))
				$arrCallbacks[$key] = $filter;
			else
				$arrValidators[$key] = $filter;
		}

		$validate = array();

		// Validate the callbacks
		foreach ($arrCallbacks as $key => $filter)
			$validate[$key] = call_user_func($this->callbacks[$filter['filter']], $filter);

		// Validate through PHP filter function
		$validate = $validate + filter_var_array($arrData, $arrValidators);

		// Check the results
		$res = array();
		foreach ($arrFilters as $key => $filter) {
			$result = isset($validate[$key]) ? $validate[$key] : null;
			if (is_null($result) || ($filter != FILTER_VALIDATE_BOOLEAN && (bool) $result == false))
				$res[$key] = $filter;
		}

		return $res;
	}