$text = explode("\n", $filinnehall); for($i = 0; $i < count($text); $i++){ echo "$i. Här gör vi nått med $text[$i]\n"; }