PHP – File() Lines


$lines = file('all-words.txt');
foreach ($lines as $line_num => $line) {
  echo "Line number ".$line_num;
}