Esempio n. 1
0
 /**
  * Converts script argument (query string or form data) to array of numeric values.
  * @param string $key Key containing potential numeric values.
  * @return mixed Returns an array if values are found for the specified key. Null otherwise.
  */
 public static function collectIntegerArrayRequestVar($key)
 {
     $args = array($key => array('filter' => FILTER_VALIDATE_INT, 'flags' => FILTER_REQUIRE_ARRAY));
     $result = Validation::_filterIntegerInputArray(INPUT_GET, $key, $args);
     if (is_array($result) && count($result) > 0) {
         return $result;
     }
     $result = Validation::_filterIntegerInputArray(INPUT_POST, $key, $args);
     if (is_array($result) && count($result) > 0) {
         return $result;
     }
     $value = Validation::collectIntegerRequestVar($key);
     if ($value !== null) {
         return array($value);
     }
     return array();
 }