ctype_digit don't support negative value in string:
<?php
var_dump( ctype_digit('-10') ); //return bool(false)
?>
Improved (and simplified) Tim Boormans code:
<?php
/**
* Check input for existing only of digits (numbers)
* @author Guilherme Nascimento <brcontainer@yahoo.com.br>
* @param $digit
* @return bool
*/
function is_digit($digit)
{
return preg_match('#^-?\d+$#', $digit) && is_int((int) $digit);
}