I have a array with thousand values.
$arr = array('Stone', 'Gem', 'Star', ..., 'Star', 'Rock', 'Salt', ..., 'Metal', 'Cotton', 'Gem',...);
my problem now is how can I count the values of the array.. for example:
Stone = 234
Gem = 231
Star = 123
Rock = 98
Salt = 265
...
any idea about this?
array_count_values()documentation link, returns the required array and the input array rests untouchedarray_count_values($array);