So I have a file of words. When a person enters a they should get back all anagrams of that word if any.
Example: enter 'hat' check the file for anything 3 characters with h-a-t
so this where I am at now..
$wordlist=file_get_contents('words.txt');
$word = $_POST['word'];
$word_split = str_split($word);
foreach($wordlist as $line){
if(strpos($line, $word_split) !== false){
echo $line;
}
}
This of course is not working because you cannot use an array as the needle. So I am stuck on how to do it.