// Index for php sources. // PJ Waskiewicz, 8/05/2001 // index.php $source_directory = "/home/waskiewicz.org/www/php_sources/"; $filename = "/home/waskiewicz.org/www/scripts/php_sources_index.html"; $fp = fopen($filename, "r"); $content = fread($fp, filesize($filename)); fclose($fp); // The idea is to grab all .phps files in the current directory and // then output the list to the page. This way I can add files to the // directory later without having to update anything. :-) // Push them into an array so I can sort them alphabetically... $list_array = array(); $content_replace = ""; $dir = opendir($source_directory); while($file = readdir($dir)) { if(preg_match("/.*\.phps/", $file)) { array_push($list_array, $file); } } closedir($dir); // Sort the array rsort($list_array); reset($list_array); while($file = array_pop($list_array)) { preg_match("/(.*)\.phps/", $file, $matches); $content_replace = $content_replace . "