title: Retrieving an array of images on HTML page using PHP
body: <p>I am retrieving images from a directory using php. Images are displayed on PHP page (getUser.php) but how can these images be display on any HTML.
  <br />
  <strong>getUser.php</strong><br /></p>
  
  <pre><code>&lt;?php
  
  
  $dir = 'images';
  $file_display = array('jpg','jpeg','png','gif');
  
  if (file_exists ($dir) == false) {
      echo 'Directory \'', $dir, '\' not found!';
  }
  else{
      $dir_contents = scandir($dir);
  
  
      foreach($dir_contents as $file) {
          $file_type = strtolower(end(explode('.', $file)));
  
          If($file !== '.' &amp;&amp; $file !== '..' &amp;&amp; in_array($file_type, $file_display) == true) {
              echo '&lt;img src="', $dir, '/', $file, '" alt="', $file, '" /&gt;';
              /*echo '&lt;td&gt;';
  echo '&lt;img src =';
  echo $dir."/".$file;
  echo  '/&gt;';
  echo '&lt;/td&gt;'; */
  
          }       
  
      }
  
  }
  
  
  ?&gt; 
  </code></pre>
  
  <p><strong>one.html</strong> <br />
  I want this array of images to be displayed in  html (div). That is the source of the image tag takes reading from the PHP file. I have done this in ASP.NET but can't figure it out in PHP Is there anything like </p>
  
  <pre><code>&lt;img src="images/vimages/&lt;%=row["image"] %&gt;" ASP.NET
  </code></pre>
  
  <p>this PHP.<br /></p>
  
  <pre><code>&lt;div id="pics"&gt;
                  &lt;img src="img/...jpg" alt=""  /&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p><br /> 
  The above div will be dynamically populating using getUser.php file.</p>