我一直在尝试将我的数组结果显示在表格中 但得到这样的错误.. 消息:非法字符串偏移'id_kls'
数组显示如下
Array
(
[error_code] => 0
[error_desc] =>
[result] => Array
(
[0] => Array
(
[id_kls] => 0075ab85-cf84-4cb4-80d2-36cf721b75bc
[fk__id_kls] => 01
[id_reg_pd] => 005ffefb-2cd9-424a-8a96-937c95461e83
[nm_pd] => RIDWAN PRIHANTORO
[asal_data] => 9
[nilai_angka] =>
[nilai_huruf] => B
[nilai_indeks] => 3.00
)
继续...... 。 这里是我的代码,所有代码仍然只在控制器上..
$tampan = $proxy->GetRecordset($token, $table, $filter, $order, $limit, $offset);
$hasil = $tampan;
echo '<pre>';
print_r($tampan);
echo '</pre>';
$data = $tampan;
?>
<table border="1">
<tr>
<th>No.</th>
<th>id_kls</th>
<th>fk__id_kls</th>
<th>id_reg_pd</th>
<th>nm_pd</th>
<th>asal_data</th>
<th>nilai_angka</th>
<th>nilai_huruf</th>
<th>nilai_index</th>
</tr>
<?php $no=1; foreach($data as $key) { ?> <!-- Mulai loop -->
<tr>
<td><?php echo $no++; ?></td>
<td><?php echo $key['id_kls']; ?></td>
<td><?php echo $key['fk__id_kls']; ?></td>
<td><?php echo $key['id_reg_pd']; ?></td>
<td><?php echo $key['nm_pd']; ?></td>
<td><?php echo $key['asal_data']; ?></td>
<td><?php echo $key['nilai_angka']; ?></td>
<td><?php echo $key['nilai_huruf']; ?></td>
<td><?php echo $key['nilai_indeks']; ?></td>
</tr>
<?php } ?> <!-- Selesai loop -->
</table>
<?php
}
}
?>