note 20703 added to function.count-chars
| From: | php-general at lists dot php dot net | Date: | Sat, 13 Apr 2002 00:29:55 +0000 |
| Subject: | note 20703 added to function.count-chars | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-29183@lists.php.net to get a copy of this message | ||
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"
--
http://www.php.net/manual/en/function.count-chars.php
http://master.php.net/manage/user-notes.php?action=edit+20703
http://master.php.net/manage/user-notes.php?action=delete+20703
http://master.php.net/manage/user-notes.php?action=reject+20703