title: PHP' glob() to select images
body: <p>In my case I have a folder with a lot of images. In my source I want to get all images of ONE product.</p>
  
  <p>E.g the <strong>product ID (PID)</strong> is <strong>12345</strong>, in my folder I have images like:</p>
  
  <pre><code>123456789.jpg
  123.jpg
  1234.png
  12345.png
  12345-1.jpg
  123456-1.bmp
  12345-2.gif
  </code></pre>
  
  <p>The images I want to select is:</p>
  
  <pre><code>12345.png
  12345-1.jpg
  12345-2.gif
  </code></pre>
  
  <p>All other images or not from that product.</p>
  
  <p>At the moment I select them like:</p>
  
  <pre><code>glob("path/to/the/images/" . $product_id . "*.*", GLOB_BRACE);
  </code></pre>
  
  <p>problem is.. this also brings me images like:</p>
  
  <pre><code>123456789.jpg
  123456-1.bmp
  </code></pre>
  
  <p>Is it possible to say: bring me all images that matches the <strong>PID</strong> followed by a <strong>DOT</strong> <strong>(.)</strong> and all images that matches the <strong>PID</strong> followed by a <strong>MINUS</strong> <strong>(-)</strong> ?</p>
  
  <p>I am <a href="http://www.globtester.com/#p=eJwrSCzJ0C%2FJ18%2Bt1M%2FMTUxPLdY3NDI2MdXTAgB0rQgA&amp;r=eJy9ku8KgjAUxV9F9t0t579mc%2B8yTefCzdFGZE%2BfsqAgCoLZ%2FXi555wfh0uP8hK1I7e2BoAZ7gbkJqRmJBUXnUUJTrO8KPcEnoygaLlm9LuEWsN1ZN08djXoJ%2B1iK29dFSUE4t06ZYFJSnJzPQC2%2BnvnVcVoc2bbhGSvKb%2BIPZLXvZEp7tohCF4OjQ7PFwYtTjYpLwxcsdA1yvyD7tEGhkL2nz71ub8DlTEMSQ%3D%3D&amp;" rel="nofollow">testing it here</a> and of course in my source since a while but can't find a solution.</p>