Concisely checking the length of a trimmed string
<? if (strlen(trim("12345")) != 5) { print "Please enter a ZIP code that is 5 characters long."; } ?>
1. | Calculating the length of a string | ||
2. | Checking String Length | ||
3. | Checking String Length: int strlen ( string string ) | ||
4. | strlen.php | ||
5. | int strlen ( string str ) returns the number of characters in it: |