PHPRecent Posts

PHP get duplicate values count in an array

If you want to get duplicate values count in an array,this method can be use easily.It will display array values all count.

$myArray = array("one", "two", "three","four","five","one","four");
$my_array_values = array_count_values($myArray);
while (list ($key, $val) = each ($my_array_values))
{
   echo "$key -> $val "."  times"."
"; }

What's your reaction?

Excited
0
Happy
0
In Love
0
Not Sure
0
Silly
0

Comments are closed.

Next Article:

0 %