[eluser]wavefade[/eluser]
[quote author="gtech" date="1193894252"]Hello I looked at the documentation and can't find an option for validating signed integers.
if you look in libraries/validation.php the numeric function is a simple regular expression. you can simply change this to deal with negative and positive integers... e.g.
validation.php
Code:
...
/**
* Numeric
*
* @access public
* @param int
* @return bool
*/
function numeric($str)
{
// original code..
// return ( ! ereg("^[0-9\.]+$", $str)) ? FALSE : TRUE;
return ( ! ereg("^\-*[0-9\.]+$", $str)) ? FALSE : TRUE;
}
...
or add a new function.. maybe a feature request?[/quote]
Thanks a bunch! I used this little fix and it works great.