note 20703 deleted from function.count-chars by tularis
| From: | tularis@php.net | Date: | Mon, 27 Dec 2004 19:59:26 +0000 |
| Subject: | note 20703 deleted from function.count-chars by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-82363@lists.php.net to get a copy of this message | ||
Note Submitter:
----
You can also get the number of characters in a string using mb_strlen().
Example:
-----------------------------------
$my_string = "1234567890";
$count = mb_strlen($my_string);
echo "$count";
------------------------------------
Outputs --> 10
Remember that spaces and punctuation are counted.
So, if $my_string = "This is a string."
then the function above would output "17"