[eluser]John_Betong_002[/eluser]
Hi ivelin
With your original source your loop overwrites
$image[$key] ['info'] and you will only have the last item in your array.
Try this:
// controller
Code:
$path = 'path-to-your-picture-files';
$file = scandir(FCPATH .$path); // FCPATH set in index.php
$file = array_diff($file, array('.', '..', 'thumbs'));
$image= array();
foreach ($file as $key=> $f):
$image['THUMBNAIL'][] = array
(
'url' => $path .$f,
'thumb_url' => $path .$f
);
endforeach;
$this->load->view ( 'upload_success', $image);
// view
Code:
echo "<dl style='margin:2em'>";
foreach($THUMBNAIL as $url => $pix):
echo "<dt>" .$pix['url'] ."</dt>";
echo "<dt>" .$pix['thumb_url'] ."</dt>";
echo '<dd>'
. anchor
(
base_url() .$pix['url'],
"<img src='" .base_url() .$pix[' />"
)
.'<br /><br /></dd>';
endforeach;
echo '</dl>';
edit: forgot the closing code tag