diff options
Diffstat (limited to 'system/libraries')
-rw-r--r-- | system/libraries/Form_validation.php | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 1c0089d85..eb6031697 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -1140,7 +1140,7 @@ class CI_Form_validation { // -------------------------------------------------------------------- /** - * Greather than + * Greater than * * @param string * @return bool @@ -1155,6 +1155,24 @@ class CI_Form_validation { } // -------------------------------------------------------------------- + + /** + * Equal to or Greater than + * + * @access public + * @param string + * @return bool + */ + function greater_than_equal_to($str, $min) + { + if ( ! is_numeric($str)) + { + return FALSE; + } + return $str >= $min; + } + + // -------------------------------------------------------------------- /** * Less than @@ -1174,6 +1192,24 @@ class CI_Form_validation { // -------------------------------------------------------------------- /** + * Equal to or Less than + * + * @access public + * @param string + * @return bool + */ + function less_than_equal_to($str, $max) + { + if ( ! is_numeric($str)) + { + return FALSE; + } + return $str <= $max; + } + + // -------------------------------------------------------------------- + + /** * Is a Natural number (0,1,2,3, etc.) * * @param string |