我有一個奇怪的問題與我的foreach循環的數據輸出。該回路沒有針對$image->thumbname
,$description
或$id
但print_r($get_images);
數據正常工作foreach循環不顯示數據
print_r的輸出:
Array ([0] =>
Array ([id] => 1
[description] => testing
[imagename] => test.jpg
[thumbname] => test_thumb.jpg
))
查看:
<?php if(is_array($get_images)): ?>
<? print_r($get_images); ?>
<?php foreach($get_images as $image): ?>
<img src ="<?=base_url()?>includes/uploads/gallery/thumbs/<?=$image->thumbname?>" alt="<?= $image->description?>"> <a href="deleteimage/<?=$image->id?>">Delete</a>
<?php print_r($image); ?>
<?php endforeach; ?>
<?php endif; ?>