Validating a number with ctype_digit() : ctype_digit « Data Type « PHP






Validating a number with ctype_digit()

 
<?php
if (! ctype_digit($_POST['age'])) {
    print 'Your age must be a number bigger than or equal to zero.';
}
?>
  
  








Related examples in the same category