Welcome Guest, Not a member yet? Register   Sign In
Form Validation (extentions) Greater than / Less than a curtain number
#2

[eluser]osci[/eluser]
you can use from form validation the already defined rules greater_than and less than

or you can combine them in one rule extending form_validation
is_between[4.15] for 4 < val < 15

Code:
public function is_between($str,$val)
{
   if (! is_numeric($str))
   {
      return FALSE;
   }

   list($val, $max)=explode('.', $val);
   return (($str > $val) AND ($str < $max));
}


Messages In This Thread
Form Validation (extentions) Greater than / Less than a curtain number - by El Forum - 07-02-2011, 05:17 AM



Theme © iAndrew 2016 - Forum software by © MyBB