Home » » count_chars

count_chars

Written By 1 on Sunday, September 30, 2012 | 10:04 AM

mixed count_chars ( string $string [, int $mode = 0 ] )
Return information about characters used in a string
Counts the number of occurrences of every byte-value (0..255) in string and returns it in various ways.

<?php
$data 
"Two Ts and one F.";

foreach (
count_chars($data1) as $i => $val) {
   echo 
"There were $val instance(s) of \"" chr($i) , "\" in the string.\n";
}
?>


065 PHP من الألف إلى الياء Arabic التعامل مع النصوص Strings pt1

0 Comment:

Post a Comment