title: how to check file exist in php using only extension like (*.pdf)
body: <pre><code>$filename = '/www/test1/*.pdf';
      if (file_exists($filename)) 
      {
          echo "The file $filename exists";
      } 
      else
      {
          echo "The file $filename does not exist";
      }
  </code></pre>
  
  <p>I used above code but it checks for *.pdf file but not for all files belongs to .pdf extension</p>