Is there any function I can use to count repeated items within an array or should I use a variable?
I have the following array:
$arr = array(
itemX,
itemY,
itemX,
itemZ,
itemY
);
I’m trying to print this:
ItemX no. 1
ItemY no. 1
ItemX no. 2
ItemZ
ItemY no. 2