title: php foreach glob multiple extensions
body: <p>There has got to be a better way to write this:</p>
  
  <pre><code>&lt;?php $imagecounter = "no";
      foreach (glob("images/*.jpg") as $image)    {
      $imagecounter = "yes";
      }
      foreach (glob("images/*.png") as $image)    {
      $imagecounter = "yes";
      }
      foreach (glob("images/*.gif") as $image)    {
      $imagecounter = "yes";
      }
      if ($imagecounter == "yes"){Create gallery}?&gt;
  </code></pre>
  
  <p>That folder might have zip or pdf files too that should not create a gallery</p>