Good afternoon, there is an array:
array(12) { [2]=> string(6) "802344" [3]=> string(6) "802344" [4]=> string(6) "802344" [5]=> string(6) "802344" [6]=> string(6) "802344" [7]=> string(6) "802344" [8]=> string(6) "802344" [9]=> string(6) "802344" [10]=> string(6) "802344" [11]=> string(6) "802335" [12]=> string(6) "802335" [13]=> string(6) "802347" } It is necessary to calculate how many times the value in a line matches and display the number and values themselves as follows:
[1]=> array(17) { ["id"]=> int(7) "802335" ["quantity"]=> int(27) "2" } [2]=> array(17) { ["id"]=> int(7) "802344" ["quantity"]=> int(27) "9" } [3]=> array(17) { ["id"]=> int(7) "802347" ["quantity"]=> int(27) "1" }