實作了多圖上傳,上傳的資料夾都有圖片,但上傳到資料庫只有一條數據,我要怎麼做,我要怎麼寫控制器
html程式碼<input type=" file" name="image[]" /> <br>
#控制器要怎麼寫,求指示
RAUL2017-07-28 15:33:37
public function upload(){
// 取得表單上傳檔案例如上傳了001.jpg
$files = Request::instance()->file('image');
for instance ){
$info = $file->move('upload');
$infos = $info ->getFilename(); $date=date("Ymd",time()); $data = input('post'); $data['path'] = '/upload/ '.$date.'/'.$infos; $ret = model('Photo')->saveALL($data['pathpath']); redirect('admin/product/index'); }我要怎麼循環拿到多維數組的圖片名稱下面是打印的
> Object
(
[error:thinkFile:private] =>
[filename:protected] => C:wamptmpphpC8C2。 => date
[ validate:protected] => Array
(
)
[isTest:pro?
[key] => image
[name] => 5.jpg
[type] => image/jpeg
[tmp_name] => C:wamptmpphpC8C2.tmp
[error] = 0 ) [hash:protected] => Array ( ) [pathName:SplFileInfo:private] => C:oamp phpC8C2.tmp [openMode :SplFileObject:private] => r [delimiter:SplFileObject:private] => , [enclosure:SplFileObject:private] => "[enclosure:SplFileObject:private] => "
[enclosure:SplFile