這些都是我的代碼多個上傳文件..多文件上傳 - 如何整合所有上傳文件的縮略圖功能?
請你能幫助我的代碼交換也有縮略圖整合
public function addimage($room_id)
{
$name_array = array();
$count = count($_FILES['userfile']['size']);
foreach($_FILES as $key=>$value)
for($s=0; $s<=$count-1; $s++) {
$_FILES['userfile']['name']=$value['name'][$s];
$_FILES['userfile']['type'] = $value['type'][$s];
$_FILES['userfile']['tmp_name'] = $value['tmp_name'][$s];
$_FILES['userfile']['error'] = $value['error'][$s];
$_FILES['userfile']['size'] = $value['size'][$s];
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png|jpeg';
//$config['encrypt_name'] = uniqid(date(1));
// $config['max_size'] = '100';
// $config['max_width'] = '1024';
// $config['max_height'] = '768';
$this->load->library('upload', $config);
$this->upload->do_upload();
$data = $this->upload->data();
$name_array[] = $data['file_name'];
} // end foreach
$names= array($name_array);
print_r($names);
exit();
謝謝@PraveenD :) –