title: Selecting file names from a folder in php
body: <p>I want to get folder name from my computer in PHP code. I got the following piece of information, on searching on stackoverflow:</p>
  
  <pre><code>&lt;input type="file" name="folder" webkitdirectory directory multiple/&gt;
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/2809688/directory-chooser-in-html-page">Directory Chooser in HTML page</a></p>
  
  <p>But, the issue is the folder gives only one file name in post array.</p>
  
  <pre><code>&lt;?php 
  
  echo "I am in page.";   
  
  if ( empty($_POST['folder']))
  {
      ?&gt;
      &lt;form method="POST"&gt;
          &lt;div class="container compare_body"&gt;
              &lt;div class="row"&gt;
                  &lt;div class="col-md-3"&gt;
                      Select a Folder:
                  &lt;/div&gt;
                  &lt;div class="col-md-3"&gt;
                      &lt;input type="file" name="folder" webkitdirectory directory multiple/&gt;
                  &lt;/div&gt;
  
                  &lt;div class="col-md-3"&gt;
                      &lt;button type="submit" class="btn btn-info"&gt;List your files&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/form&gt;
  
      &lt;?php
  }
  else
  {
      print_r($_POST['folder']);
  
      echo "I am in else.";
  
  }
  ?&gt;
  </code></pre>
  
  <blockquote>
    <p>I am in page.WWW.YIFY-TORRENTS.COM.jpgI am in else.</p>
  </blockquote>
  
  <p>Edit : I tried <code>GET</code> method, which results in the following query:</p>
  
  <pre><code>http://localhost/thrillermovie/yourmovies?folder=2.png&amp;folder=facebook_post.png&amp;folder=callhistorycontrol.png&amp;folder=khan.jpg&amp;folder=minimization.png&amp;folder=obama_knows.png&amp;folder=facebook.png&amp;folder=wildkrafts.png&amp;folder=dekho.png&amp;folder=sub.png&amp;folder=2_batman.png&amp;folder=best+response.png&amp;folder=moore.png&amp;folder=admob.png&amp;folder=adrspeechcode.png&amp;folder=batman_story.png&amp;folder=comparemovies.png&amp;folder=landevicefound.png&amp;folder=it&amp;folder=device-2015-08-19-005229.png&amp;folder=bhakta.png&amp;folder=Screenshot+from+2015-09-19+23%3A16%3A09.png&amp;folder=arrow.png&amp;folder=raghib_comment.png&amp;folder=web_hi_res_512.png&amp;folder=nfa_dfa.png&amp;folder=raghiblul.png&amp;folder=tux.png&amp;folder=lexical.png&amp;folder=likes.png&amp;folder=raghib_lul.png&amp;folder=bluegape.png&amp;folder=con.png&amp;folder=dfa_conversion.png&amp;folder=bhakto+ko.png&amp;folder=mynumber.png&amp;folder=katjuJiReply.png&amp;folder=tifY9AWf_400x400.jpg&amp;folder=kalam.jpg&amp;folder=bk.png&amp;folder=1.png&amp;folder=1_batman.png&amp;folder=mealay.png
  </code></pre>
  
  <p>but output is only the last folder name.</p>
  
  <p>Please help me to solve the problem.</p>