note 74213 added to function.count-chars
| From: | apinpratap at gmail dot com | Date: | Fri, 30 Mar 2007 06:54:27 +0000 |
| Subject: | note 74213 added to function.count-chars | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124940@lists.php.net to get a copy of this message | ||
this code can find each characters count
<?php
$enter = 0;
$data = strtolower ($inputString);
foreach (count_chars ($data, 1) as $i => $val)
{
if ($enter == 1)
{
$enter = 0;
continue;
}
if (chr ($i) == "\n")
{
echo "There are $val instance(s) of \" Enter \" in the string.\n";
$enter = 1;
}
else
{
echo "There are $val instance(s) of \"" , chr ($i) , "\" in the
string.\n";
}
}
?>
----
Server IP: 203.199.114.50
Probable Submitter: 61.11.124.58
----
Manual Page -- http://www.php.net/manual/en/function.count-chars.php
Edit -- https://master.php.net/note/edit/74213
Del: integrated -- https://master.php.net/note/delete/74213/integrated
Del: useless -- https://master.php.net/note/delete/74213/useless
Del: bad code -- https://master.php.net/note/delete/74213/bad+code
Del: spam -- https://master.php.net/note/delete/74213/spam
Del: non-english -- https://master.php.net/note/delete/74213/non-english
Del: in docs -- https://master.php.net/note/delete/74213/in+docs
Del: other reasons-- https://master.php.net/note/delete/74213
Reject -- https://master.php.net/note/reject/74213
Search -- https://master.php.net/manage/user-notes.php