I have a file dict.txt with its content
a
aah
aahed
aahing
aahs
b
baa
baaed
baaing
baal
baalism
baalisms
baals
baas
baba
babas
babbitting
babble
babbled
babbler
How can I read that file start with a or other only.
I know the function file_get_contents will got the string content in file,
function getStartWith($letter){
$allListStartWithWord = array();
$source = __SITE_PATH."/tmp/wordsEn.txt";
$content = file_get_contents($source );
$all_list = explode('\n', $content ); // it is big one
fclose($fh);
return $allListStartWithWord;
}
anyone could told me the ways to do that with the large file something like All English Word.
Reads the file line by line