Reduce size of multiple uploaded images
In your HTML View you can use this
&lt;file name="upload[]" accept="image/*" multiple&gt; multiple and accept attribute is only available in HTML5 dosen't work in old browsers.

&lt;?php
    $files = null;
    $errors = null;

    define('IMAGE_TARGET',SITE_ROOT.'j2reimage'.DS.'image');

    if(!empty($_POST['submitImage']))
    {
        $files = $_FILES['upload'];
        $errors = array();

        if(!empty($files))
        {
            //Move extension list to here you don't need redeclarate variables inside loop
            $valid_extensions = array('jpeg','jpg','png','gif'); 

            foreach($files as $file)
            {

                    //Don't use explode for extensions
                    //$file_ext = explode('.',$file['name'][$key]);
                    //Use pathinfo
                    $path_parts = pathinfo($file);                
                    $file_ext = $path_parts['extension'];

                    //$file_ext=strtolower(end(explode('.',$file['name'][$key])));

                    if(in_array($file_ext,$valid_extensions) === false)
                    {
                        $errors[] = ".$file_ext extension not allowed";
                    }
                    else
                    {
                        $filetmp = $file['tmp_name'][$key];

                        $dat = strftime("%Y-%m-%d %H:%M:%S", time());

                        if(file_exists(IMAGE_TARGET.DS.$file['name']))
                        {
                            //move_uploaded_file( $filetmp, $terget_path.'/'.$file['name'][$key]);              
                            mysql_query("INSERT INTO 4j2memberimage VALUES ('', $memmem-&gt;id,'{$file['name']}', '$dat')"); 

                            //if(move_uploaded_file($filetmp, $terget_path.'/'.$file['name'][$key] ))

                            //Use copy insteds of  move_uploaded_file sometimes you have right problems in some servers.

                            if(copy($filetmp, IMAGE_TARGET.DS.$file['name'] ))
                            {                   
                                $exe = explode(".", $file['name']);
                                $ext = $exe[1];
                                $w = 250;
                                $h = 250;
                                $target  = IMAGE_TARGET.DS.$file['name'];                 
                                $newcopy = IMAGE_TARGET.DS.'thumb_'.DS.$file['name'];

                                list($w_orig, $h_orig) = getimagesize($target);
                                $scale_ratio = $w_orig / $h_orig;

                                if (($w / $h) &gt; $scale_ratio)
                                {
                                    $w = $h * $scale_ratio;
                                }
                                else
                                {
                                    $h = $w / $scale_ratio;
                                }

                                $img = '';
                                $ext = strtolower($ext);

                                switch($ext) {
                                    case 'gif':
                                        $img = imagecreatefromgif($target); 
                                        break;
                                    case 'png':
                                        $img = imagecreatefrompng($target); 
                                        break;
                                    case 'jpeg':
                                    case 'jpg':
                                        $img = imagecreatefromjpeg($target);
                                        break;                                                              
                                }

                                $tci = imagecreatetruecolor($w, $h);
                                imagecopyresampled($tci, $img, 0, 0, 0, 0, $w, $h, $w_orig, $h_orig);

                                if(@imagejpeg($tci, $newcopy, 80))
                                {
                                    //return true;
                                    $target_path = $target; 
                                    //$terger_path = SITE_ROOT.DS.$this-&gt;img_path.DS.$this-&gt;filename;
                                    file_put_contents($target_path,$img);
                                    //return unlink($target_path) ? true : false;                     
                                }
                            }
                            //end of if file_exists     
                        }
                        else
                        {
                            $errors[] = 'Upload extention could not be located';            
                        }
                    }
                    //redirect_to('inb.php');                   
                }//foreach      
        }
        else
        {
            $errors[] = ' The file could not be empty ';            
        }//if
    }//if