Jump to content

jcbones

Staff Alumni
  • Content Count

    2,653
  • Joined

  • Last visited

  • Days Won

    8

jcbones last won the day on June 27 2015

jcbones had the most liked content!

Community Reputation

52 Excellent

About jcbones

  • Rank
    Prolific Member
  • Birthday 05/16/1975

Profile Information

  • Gender
    Male
  • Location
    North Carolina
  1. Change: if(in_array($file,array('.','..'))) { continue; } To: if(in_array($file,array('.','..')) || strrchr($file,'.') == '.LCK') { continue; } This is un-tested, so let me know how it goes.
  2. Replace that line with these two lines. $name = strrchr($value,'/'); echo '<li><a href="'.$value.'">'.substr($name,1).'</a></li>';
  3. Yes, the optional parameter to strstr() is available only on PHP 5.3.0 and later versions. Hold on a sec, and I will get a work around to that.
  4. From my library. Make sure you don't close the directory with a slash. ex. full/path/to/directory/ <-wrong full/path/to/directory <-right <?php function dirContents($dir) { if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if(in_array($file,array('.','..'))) { continue; } if(is_dir($dir.'/'.$file)) { $contents[$dir.'/'.$file] = dirContents($dir.'/'.$file); } else { $contents[] = $dir . '/' . $file; } } closedir($dh); } } return $contents; } function processArray($array) { if(is_array($array)) { echo '<ol>'; foreach($array as $key => $value) { if(is_int($key)) { echo '<li><a href="'.$value.'">'.str_replace('/','',strstr(strrchr($value,'/'),'.',true)).'</a></li>'; } else { echo '<li><span style="font-weight:bold">' . $key . '</span>'; processArray($value); echo '</li>'; } } echo '</ol>'; } } processArray(dirContents('PATH TO DIRECTORY')); ?>
  5. I am astonished there is not one mention of programmers notepad. While not my favorite editor, it offers things that notepad++ doesn't, and allows for quite a bit of customization. http://www.pnotepad.org/
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.