Forum Moderators: coopster
1) search any value in a file(note, not a defined one, it has to search for same words!)
2) remove any string that has that value in it.. but!
3) except the first string
Im googling here and there, but nothing cleaned my mind, Im still wondering how it could be done, and I dont have much time, dont wanna sick my superior
Can someone help me out?
Salut
r4ndomone
rand0m two
Random two2
raNdom three
ranDom three2
the rows that contain same words, for example 'two' or 'three' turn me in troubles, cause looking for example for the word "chocolate" is of course easy.. but its less when you dont know what will be double
// $data = your input;
$words = preg_split('%\b%', $data, -1, PREG_SPLIT_NO_EMPTY);
$uniqWords = [url=http://uk3.php.net/manual/en/function.array-unique.php]array_unique[/url]($words);
<edit>
Array_unique is case sensitive, but there is a function in the manual comments that can be used for a case insensitive version.
[edited by: PHP_Chimp at 2:45 pm (utc) on Nov. 7, 2007]