Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

count_chars (PHP 4, PHP 5, PHP 7, PHP 8) count_chars — Return information about characters used in a string

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

foreach (count_chars($data, 1) as $i => $val) {
   echo "There were $val instance(s) of "" , chr($i) , "" in the string.
";
}
?>
Source by www.tutorialrepublic.com #
 
PREVIOUS NEXT
Tagged: #PHP #PHP #PHP #Return #information #characters #string
ADD COMMENT
Topic
Name
3+6 =