I have a database query that pulls out strings of text
$descriptionsQuery = mysql_query("select prob_text from opencall where logdatex between $OneHourAgo and $TimeNow ORDER by callref DESC") or die(mysql_error());
$descriptions = array();
while ($row = mysql_fetch_assoc($descriptionsQuery)){
$descriptions[] = $row['prob_text'];
}
//put all the strings together with a space between them
$glue = implode (" ",$descriptions);
What I'm wanting help with is... before the "descriptions[]" are "glued" to be one long string, I'm wanting any duplicate words removing. Once they are glued, I'm relying on there being duplicate words from each original description. It's kind of hard to explain, here's an example of what I mean. 2 users input some text, for example
User1: "I have an issue with Leeds server. I am in Leeds"
User2: "Margaret in Leeds has a problem, please call margaret"
. From this, I would like User1 to only have 1 "Leeds" in the final glued string, User2 only have 1 margaret, but both users mention "Leeds" so I would like that there twice in the glued string, once from each user. Is this possible? Any help appreciated.