ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Compare.php
Go to the documentation of this file.
1 <?php
2 
4 
7 
8 class Compare
9 {
26  public static function DELTA($a, $b = 0)
27  {
30 
31  try {
34  } catch (Exception $e) {
35  return $e->getMessage();
36  }
37 
38  return (int) ($a == $b);
39  }
40 
56  public static function GESTEP($number, $step = 0)
57  {
58  $number = Functions::flattenSingleValue($number);
60 
61  try {
62  $number = EngineeringValidations::validateFloat($number);
64  } catch (Exception $e) {
65  return $e->getMessage();
66  }
67 
68  return (int) ($number >= $step);
69  }
70 }
foreach( $_REQUEST as $var) foreach(array('_POST'=> 'HTTP_POST_VARS', '_GET'=> 'HTTP_GET_VARS', '_COOKIE'=> 'HTTP_COOKIE_VARS', '_SERVER'=> 'HTTP_SERVER_VARS', '_ENV'=> 'HTTP_ENV_VARS', '_FILES'=> 'HTTP_POST_FILES') as $array=> $other) $step
Definition: cssgen.php:155
static flattenSingleValue($value='')
Convert an array to a single scalar value by extracting the first element.
Definition: Functions.php:649