use ctype_digit() and (int) to substitute is_numeric() and intval()