PHP Checking String Length: Int Strlen ( String String ) – String Function

<?php define ("MAXLENGTH", 10);
if (strlen ("Hello World!") > MAXLENGTH){
    echo "The field you have entered can be only " . MAXLENGTH . " characters in length.";
}
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.