php - If $_POST variable is not 3 numbers long -


i person's weight, on 18 years old 100 pounds plus, want check if $_post variable weight entered 3 digits only. have form user enters weight...

if (!is_numeric($weight)) {     echo "you did not enter numeric weight.";     die; } 

using above make sure it's numeric... want verify number 3 digits.

thank you

you can do:

is_numeric($weight) && ($weight > 99) && ($weight < 1000) 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -