I have a group of letter that consists letters like
$words= 'estroaroint';
that can be arranged to be some words in my list
$file = 'dictionary.txt'
Here my expected result that on my words list:
STORE
REST
TRAIN
RESTORATION
...etc
I searched on google and found like :
$contents = file_get_contents($file);
$pattern = preg_quote($words, '/');
$pattern = "/^.*$pattern.*\$/m";
if(preg_match_all($pattern, $contents, $matches)){
echo "Found matches:\n";
echo implode("\n", $matches[0]);
echo strlen($matches);
}
else{
echo "No matches found";
}
But that's not like as my expectation
Thanks in advance
Warm Regard