note 101740 modified in function.strlen by danbrown
| From: | danbrown@php.net | Date: | Sat, 08 Jan 2011 16:56:56 +0000 |
| Subject: | note 101740 modified in function.strlen by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-175535@lists.php.net to get a copy of this message | ||
Hello all,
May I pos my firs function as novice in php here .
This funtion count all characters in a strign without spaces , so only chars, no spaces .
<?php
function countchar ($string) {
$result = strlen ($string) - substr_count($string, ' ');
echo $result;
}
countchar ($a);
?>
Hope to be useful for somebody !
--was--
Hello all,
May I pos my firs function as novice in php here .
This funtion count all characters in a strign without spaces , so only chars, no spaces .
function countchar ($string) {
$result = strlen ($string) - substr_count($string, ' ');
echo $result;
}
countchar ($a);
Hope to be useful for somebody !
http://php.net/manual/en/function.strlen.php