I am pulling out a list of popular product IDs into an array that looks like this
Array
(
[0] => stdClass Object
(
[popular_product] => 2,60
)
[1] => stdClass Object
(
[popular_product] => 12,61,60
)
[2] => stdClass Object
(
[popular_product] => 2
)
[3] => stdClass Object
(
[popular_product] => 9
)
[4] => stdClass Object
(
[popular_product] => 14
)
)
I want to create a new array that shows me what the most popular products are by count, my approach is this
Combine all popular_product ids into one long comma seperated string like this
2,60,12,61,60,2,9,14
Is this the most efficient approach?