$arr1
= [
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'e'
,
'a'
,
'a'
];
$arr
=
array_count_values
(
$arr1
);
echo
'<pre>'
;
print_r(
$arr
);
result:
Array
(
[a] => 3
[b] => 1
[c] => 1
[d] => 1
[e] => 2
)
2024-02-02 14:47:22
$arr1
= [
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'e'
,
'a'
,
'a'
];
$arr
=
array_count_values
(
$arr1
);
echo
'<pre>'
;
print_r(
$arr
);
result:
Array
(
[a] => 3
[b] => 1
[c] => 1
[d] => 1
[e] => 2
)