How to read a directory outside of current directory with PHP opendir?
<p>I cannot seem to get the bolded file path to work. I would like the script to scan Dir_3. Any help would be very appreciated.</p>

<pre><code> &lt;?php

  // These files will be ignored
  $excludedFiles = array (
'excludeMe.file',
'excludeMeAs.well'
);

// These file extensions will be ignored
$excludedExtensions = array (
  'html',
'xslt',
'htm',
'ahk',
'xsl',
'txt',
'xml'
);

// Make sure we ignore . and ..
$excludedFiles = array_merge($excludedFiles,array('.','..')); 

 // Convert to lower case so we are not case-sensitive
 for ($i = 0; isset($excludedFiles[$i]); $i++) $excludedFiles[$i] =        
 strtolower(ltrim($excludedFiles[$i],'.'));
  for ($i = 0; isset($excludedExtensions[$i]); $i++) $excludedExtensions[$i] =    
 strtolower($excludedExtensions[$i]);

  // Loop through directory
  $count = 0;
  if ($handle = opendir('**http://www.mydomain.com/Dir_1/Dir_2/Dir_3/**')) {
  while (false !== ($file = readdir($handle))) {
  $extn = explode('.',$file);
  $extn = array_pop($extn);
  // Only echo links for files that don't match our rules
  if (!in_array(strtolower($file),$excludedFiles) &amp;&amp;   
  !in_array(strtolower($extn),$excludedExtensions)) {
    $count++;
    print("&lt;a href=\"".$file."\"&gt;".$file."&lt;/a&gt;&lt;br /&gt;\n");
  }
}
echo '&lt;br /&gt;&lt;br /&gt;&lt;a href=".."&gt;Return&lt;/a&gt;';
closedir($handle);
}

?&gt;
</code></pre>
