Hello.
I have to methods, both work.
I was wondering what everyone thought about which method was better to use!
Method #1
if (strlen($comments) < 15) {
print "Sorry, your message must have at least 15 characters!";
exit;
}
if (strlen($comments) > 500) {
print "Sorry, your message may not have more then 500 characters!";
exit;
}
Method #2
$limit = array(15 ,500);
if (strlen($in['comments']) < $limit["0"] || strlen($in['comments']) > $limit["1"]) { die("Sorry, your message has to be between $limit[0] and $limit[1] characters."); }
That's It!
Later,
JbA