function get_second_words() {
$NWords = array();
$file = file("data.txt");
$N = 3;
foreach ($file as $line) {
if (trim($line) != '') {
$expl = explode(" ", $line);
$NWords[] = $expl[$N - 1];
}
}
return $NWords;
}
echo implode(', ', get_second_words());
/*
run:
a, especially, originally, in, implementation
*/