我的第二个数组有问题,无法在表格中显示它.. 谁能帮帮我..
<?php
$logdate = "20140918";
$fileloc = $logdate."TPL.log";
if (file_exists($fileloc)) {
$result = array();
$file = explode("\n", file_get_contents($fileloc));
$rowFile = count($file);
?>
<table cellpadding="5" cellspacing="0" width="100%" border="1">
<thead>
<tr>
<th>#</th>
<th>Transaction ID</th>
<th>X</th>
</tr>
</thead>
<tbody>
<?php
$x=1;
foreach ( $file as $content ) {
$result[] = array_filter(array_map("trim", explode(";", $content)));
?>
<tr>
<td><?=$x?></td>
<td><?=$result[$x][0]?></td>
<td><?=$result[$x][9]?></td>
</tr>
<?php
$x++;
}
?>
</tbody>
</table>
<?php
} else {
echo "File x exists";
}
?>
实际上我想将记录插入数据库..但我希望它首先在表中查看。我想如何查看列中的爆炸结果..