title: Remove the extension from a file name and include all files in directory
body: <p>I looked on the forums but did not find what I need. 
  I need help to delete the extension from the file name, and include all files for example (php files) from a directory, and show you examples.</p>
  
  <p>This code work  </p>
  
  <pre><code>$name = 'file.php';    
  $fileName= pathinfo($name, PATHINFO_FILENAME );
  
  echo "Name: {$fileName}";
  
  Results:
  
  Name: file
  </code></pre>
  
  <p>but how do I get this with several files included in the folder</p>
  
  <pre><code>&lt;?php          
  $dir = "/dir1/dir2/dir3/dir4/";
  $phpfiles = glob($dir . "*.php");
  
  foreach ($phpfiles as $phpfile){
  
       echo '&lt;li&gt;&lt;a href="'.$phpfile.'"&gt;'.basename($phpfile,".php").'&lt;/a&gt;&lt;/li&gt;'; 
  }
  output
  1.php
  2.php
  3.php
  4.php
  -----------------
  how to insert path info in this script so that all files are included without extensions.
  ?&gt;
  </code></pre>