check if a number input value has 4 digits php code example Example: php is variable a number if(is_numeric($what_am_i)){ //true }