jestem początkującym i mam problem zrobiłem edycje danych poprzez formularz (na plikach txt) ale wyświetla mi tylko ostatnio dodane dane

Co trzeba zmienić aby pokazywało wszytkie dane a nie tylko oatanią linijke ?
Kod
<?
$file = file("a.txt");
$total = count($file);
for($i=0; $total > $i; $i++){
$split = explode("||", $file[$i]);
}
?>
<form action="zapisz.php" method="post">
<input type="text" name="gracz" size="45" value=<? echo $split[1]; ?> ><br>
<input type="text" name="druzyna" size="45" value=<? echo $split[2]; ?> ><br>
<input type="text" name="link" size="45" value=<? echo $split[3]; ?> ><br>
<input type="text" name="gol" size="45" value=<? echo $split[4]; ?> ><br>
<input type="submit" value="submit"><br>
</form>
$file = file("a.txt");
$total = count($file);
for($i=0; $total > $i; $i++){
$split = explode("||", $file[$i]);
}
?>
<form action="zapisz.php" method="post">
<input type="text" name="gracz" size="45" value=<? echo $split[1]; ?> ><br>
<input type="text" name="druzyna" size="45" value=<? echo $split[2]; ?> ><br>
<input type="text" name="link" size="45" value=<? echo $split[3]; ?> ><br>
<input type="text" name="gol" size="45" value=<? echo $split[4]; ?> ><br>
<input type="submit" value="submit"><br>
</form>