PHP Concisely Checking Length Of Trimmed String – String Function

<?
if (strlen(trim("12345")) != 5) {
    print "Please enter a ZIP code that is 5 characters long.";
}
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.