Mega Code Archive

 
Categories / Php / Strings
 

Checking String Length

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