Example #1
0
 /**
  * Returns request variable as explicit float value, or null if the request variable is not set or does not
  * represent a float value.
  * @param string $key Key in the collection storing the value to look up.
  * @param int $index Index of the array to look up, if the variable's value is an array.
  * @param array $src Array to search for $key, e.g. $_GET or $_POST
  * @return float|null
  */
 public static function parseFloatInput($key, $index = null, $src = null)
 {
     $value = Validation::parseNumericInput($key, $index, $src);
     if ($value !== null) {
         return (double) $value;
     }
     return null;
 }