列数与第1行的值计数不匹配
public function file_upload($file,$dir)
{
$uploads_dir = $dir;
$original_file = addslashes($file['name']); // storing file name
$buffer_path = $file['tmp_name']; // storing temp buffer path
$unique_name = time().$original_file; // creating unique file name by appending time stamp
$path = $uploads_dir.$unique_name;
// uploading file using default function
if(move_uploaded_file($buffer_path,$path))
{
return $path;
}
else
{
return "No";
}
}
function multiple_image_upload($file,$path)
{
//echo "<pre>";print_r($file);
if(empty($file['name'][0]))
{
return "No file selected";
}
else
{
$cnt = 0 ;
foreach($file['name'] as $filename)
{
$buffer_path = $file['tmp_name'][$cnt];
$unique_file_name = $path.date('Y-m-d H-i-s').time().$filename;
move_uploaded_file($buffer_path,$unique_file_name);
$final_file_path[] = $unique_file_name;
$cnt++;
}
return $final_file_path;
}
}
function multiple_thumb($msg,$filedata,$thumb_folder)
{
if(!is_dir($thumb_folder))
{
mkdir($thumb_folder,0755);
}
$cnt=0;
foreach($msg as $val)
{
/* echo $val;
echo "<br />"; */
//echo "<pre>";
//print_r($filedata['name']);
$o_image = imagecreatefromjpeg($val);
$o_width = imageSX($o_image);
$o_height = imageSY($o_image);
$n_width = 230;
$n_height = 250;
$new_image = imagecreatetruecolor($n_width,$n_height);
//print_r($new_image);
imagecopyresampled($new_image,$o_image,0,0,0,0,$n_width,$n_height,$o_width,$o_height);
$thumb_unique_path = $thumb_folder.date('Y-m-d H-i-s').time().$filedata['name'][$cnt];
imagejpeg($new_image,$thumb_unique_path);
$thumb_final_data[] = $thumb_unique_path;
$cnt++;
}
//print_r($thumb_final_data);
return $thumb_final_data;
}