Re: count characters
| From: | Jason Sheets | Date: | Sun, 12 Jan 2003 18:36:48 +0000 |
| Subject: | Re: count characters | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-131346@lists.php.net to get a copy of this message | ||
Try the following code, please note you may want to trim() the string as
well if it is coming from a user.
<?php
$char = 'hello world';
$number_characters = strlen(str_replace(' ', '', $char'));
?>
Jason
On Sun, 2003-01-12 at 10:32, harald.mohring@gmx.de wrote:
> I want to count characters without space "character".
> $char="hello world"
> so the result should be 10.
> Can anybody help me?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php