I have an array which contains strings and I need to group them accordingly. Please advise.
Array (
[0] => string1
[1] => string1
[2] => string2
[3] => string2
[4] => string3
[5] => string1
)
I need the output as follows:
string1
string2
string3
How can I achieve this?