how to remove a duplicate word within a string , whereby this string is a value of an array ?
e.g
foreach($results as $result)
{
foreach($result as $words)
{
echo $words = str_word_count($words,0)."
";
}
}
result is e.g
test = 1
test activity = 2
test CI to CGI = 4
Test car Pool = 3
what i want to happen is, e.g remove the other duplicates of the word "test" and list all the unqiue word so that the result will only be
test = 1
activity = 1
CI = 1
to = 1
CGI = 1
car = 1
pool = 1