Hi, I have a problem I don't know how to get it to work the best way.
I need to loop trough an array like the one below. I need to check if the [country] index is equal to a Spanish speaking country (lot of countries I predefine) and then get those [title] indexes of the correspondent country, check for duplicates and create new more compact and simplified array.
The original array:
Array
(
[0] => Array
(
[title] => Jeux de pouvoir
[country] => France
)
[1] => Array
(
[title] => Los secretos del poder
[country] => Argentina
)
[2] => Array
(
[title] => Los secretos del poder
[country] => Mexico
)
[3] => Array
(
[title] => El poder secreto
[country] => Uruguay
)
)
goes on and on....
To help you understand, the final result I need to get looks something like this:
Array (
[0] => Array
(
[title] => Los secretos del poder
[country] => Argentina, Mexico
)
[1] => Array
(
[title] => El poder secreto
[country] => Uruguay
)
)
As you can see, when there is the same title for lot of countries the array gets simplified by adding those contries to the same [country] index of the corresponding [title].
How would you do it???