HOW TO USE THE strlen() FUNCTION IN PHP
The strlen() function gives you a count of the number of characters in a string.
Example 1:
$string="Vacation";
$noOfChars=strlen($string);
echo $noOfChars;
The above will output: 8
Example 2:
$string="My Name Is John Smith";
$noOfChars=strlen($string);
echo $noOfChars;
The above will output: 21. Note that a single whitespace is also considered a character.
|