Ben bir HTML tablosunda kaydı bu tip var:
<tr class="simplehighlight" onclick="window.location.href='./games/game191.php';">
<td>06/09/2007</td><td>Jennifer Woods Memorial Grand Prix</td><td>C54</td>
<td>Nikolayev, Igor</td><td>2431</td><td>Parry, Matt</td><td>2252</td><td class="text-center">1-0</td></tr>
Ben, sınırlandırılmış bir dosyayı okumak bir dizi yapmak ve tablo doldurmak istiyorum: (numune kayıt)
game191|06/09/2007|Jennifer Woods Memorial Grand Prix|C54|Nikolayev, Igor|2431|Parry, Matt|2252|1-0
Bu çalıştı, ancak yalnızca (/games.csv
) veri dosyası son kayıt görüntüler
<?php
// open delimited data file "|" if needed and read.
//game191|06/09/2007|Jennifer Woods Memorial Grand Prix|C54|Nikolayev, Igor|2431|Parry, Matt|2252|1-0
if(!isset($_SESSION['games_array'])) {$file = $_SERVER['DOCUMENT_ROOT'].'/games.csv';
$fp = fopen($file,"r"); $list = fread($fp, filesize($file));
$_SESSION['games_array'] = explode("\n",$list); fclose($fp);}
// extract variables from each tuple by iteration
foreach ($_SESSION['games_array'] as $v);{
$token = explode("|", $v);
//write the table row and table data
echo "<tr class=\"simplehighlight\" onclick=\"window.location.href='./games/";
echo $token[0]; echo ".php';\">";
echo "<td>";echo $token[1];echo "</td>"; echo "<td>";echo $token[2];echo "</td>";
echo "<td>";echo $token[3];echo "</td>"; echo "<td>";echo $token[4];echo "</td>";
echo "<td>";echo $token[5];echo "</td>"; echo "<td>";echo $token[6];echo "</td>";
echo "<td>";echo $token[7];echo "</td>";
echo "<td class=\"text-center\">"; echo $token[8];echo "</td>";
echo "</tr>";};
?>
Ne eksik?