Reduce multiple image size
<p>Edit 
I am young programmer with ability to learn more, I am create public site, where user can upload many picture at a time, the code function successfully and insert into mysql. as I improved the code further by reduce the size of many uploaded picture at once, only a picture was uploaded into the folder and mysql.<br>
could any one please elite me more. Is there any style or code to reduce size of multi image upload by user? </p>

<p>DS in my code is  DIRECTORY_SEPARATOR define in initialize file. </p>

<p>Please I real like to know more. this is my code which uploaded in php folder and mysql. how can I reduce the size of multiple image uploaded by single user.</p>

<pre><code>if(isset($_POST['submitImage'])){
        $file = $_FILES['upload'];
        $errors = array();

        if(empty($file)){
            $errors[] = ' The file could not be empty ';
        }else{  

            foreach( $file['name'] as $key =&gt; $value ){
                $extensions = array("jpeg","jpg","png"); 
                $file_ext=explode('.',$file['name'][$key])  ;
                $file_ext=end($file_ext);
                //$file_ext=strtolower(end(explode('.',$file['name'][$key])));
                if(in_array($file_ext,$extensions ) === false){
                    $errors[]="extension not allowed";
                }else{

                    $filetmp = $file['tmp_name'][$key];
                    $terget_path = SITE_ROOT.'j2reimage'.DS.'image'.DS;
                    $dat = strftime("%Y-%m-%d %H:%M:%S", time());

                    if(file_exists($terget_path)){
                        move_uploaded_file( $filetmp, $terget_path.'/'.$file['name'][$key]);
                        mysql_query("insert into 4j2memberimage values ('', $memmem-&gt;id,'{$file['name'][$key]}', '$dat')"); 




                    //end of if file_exists     
                    }else{
                        $errors[] = ' Upload extention could not be locate';            
                    }
                }
                    //redirect_to('inb.php');                   
            }
        }





}
</code></pre>
