Well this is what I sort of have come up with. I do not think any pre-made commercial script is out there.
I found this for documentation on strings:
http://us2.php.net/manual/en/ref.strings.php
And then someone gave me this code
- if it works - fantastic:
Code:
// Text file containing words
$txt = '/path/to/wordfile.txt';
$handle = fopen($txt, 'r');
if (!$handle) {
die('Could not open...');
}
// set up arrays for storing words and concatenated words
$words = array();
$cwords = array();
// get the words
while (!feof($handle)) {
// strip_newlines is not a real function - needs to be implemented
array_push($words, strip_newlines(fgets($handle)));
}
// while we still have words
for ($i = 0; $i < count($words); $i++) {
// get the current word
$curword = $words[$i];
// loop over the words
foreach ($words as $word) {
// if the word is the same as the current word, skip it - i.e. no CatCat
if ($word == $curword) {
continue;
}
// append the concatenated word to the array
array_push($cwords, $curword.$word);
}
}
print_r($words);
print_r($cwords);
(Sorry we usually work on ASP actually).
Bookmarks