How to use foreach for multiple image upload using php and mysql
<p>Here is my Form:      </p>

<pre><code> &lt;form action="" method="post"   enctype="multipart/form-data"&gt;
     &lt;input  type="file" name="file[]" id="file" /&gt; 
     &lt;input type="submit" value="Upload Image" name="submit"&gt;
&lt;/form&gt;
</code></pre>

<p>Here is my php:</p>

<pre><code> &lt;?php
     $file=$_FILES['file']['name'];
     $dest="uploads/$file";
     $src=$_FILES['file']['tmp_name'];
     move_uploaded_file($src,$dest);
 ?&gt;
</code></pre>

<p>How to use <code>foreach</code> after hitting the submit button? kindly guide me please.</p>

<pre><code>MY FOR EACH GIVES ONLY ONE VALUE. I UPLOADED MORE THAN TWO IMAGE.iT SHOWS LAST ONE
foreach($_FILES['file']['name'] as $k=&gt;$v)
{

echo "File : ", $_FILES['file']['name'][$k] ," is valid, and was                      successfully uploaded.\n";
}
</code></pre>