如果我們打印「; print_r($ totalteachersget); die;?>我從這個數組中獲取值,然後我們得到下面的數組,現在我想把它作爲行行格式在html中,我的html代碼也在吹 - 請修正我的html代碼。如何從行數組中獲取多個值作爲行格式
---------------------------- ----陣列結果---------------------------------
Array
(
[0] => Array
(
[totalteachers] => Array
(
[0] => stdClass Object
(
[teacher_id] => 1
[teacher_name] => Amit Rathore
[mobile_number] => 99999999
[email] => [email protected]
[password] => e6e061838856bf47e1de730719fb2609
[gender] => male
[address] => nothing address
[rand_number] => eFhohRkL
[status] => 1
[created_at] => 2017-01-09 02:24:54
[logout_time] => 2017-01-27
)
)
)
[1] => Array
(
[totalteachers] => Array
(
[0] => stdClass Object
(
[teacher_id] => 49
[teacher_name] => thomas joy
[mobile_number] =>
[email] => [email protected]
[password] => 8a6d4494109584e7d36ed19b2dd3cb16
[gender] =>
[address] =>
[rand_number] => jgqf0RTG
[status] => 1
[created_at] => 2017-04-01 05:41:50
[logout_time] =>
)
)
)
)
---- --------------------------------- HTML代碼--------------- ------------------
<tbody>
<?php if(!empty($totalteachersget)) {
$i =1;
foreach($totalteachersget as $teacherslist=>$values) {
foreach($totalteachers as $secondvalues) {
$teacher_id = base64_encode(base64_encode(base64_encode($secondvalues->teacher_id)));
?>
<tr class="<?php // echo $bgcolor; ?>">
<td class="col-chk"><!--<input type="checkbox">--></td>
<td class="col-first"><?php echo $secondvalues->teacher_name; ?></td>
<td class="col-third"><?php echo $secondvalues->mobile_number; ?></td>
<td class="col-second"><?php echo $secondvalues->email; ?></td>
<td class="col-second"><?php if($secondvalues->status == 0){ echo "Not confirmed"; } else { echo "Confirmed"; } ?></td>
</tr>
<?php $i++; } } }else{ ?>
<tr><td class="col-chk" colspan="10">No records found </td></tr>
<?php } ?>
</tbody>
你到底想幹什麼? – Pacio