setFlags(RecursiveDirectoryIterator::SKIP_DOTS); $iter = new RecursiveIteratorIterator($dir); $i=0; echo "+".str_repeat("-", 65)."+\n\n"; foreach ($iter as $phlogdir) { $path=$phlogdir->getPathname(); if (str_contains($path, "/gophermap") || ($path=="/srv/gopher/phlog/rss.xml") || ($path=="/srv/gopher/phlog/search.php")) continue; $content = strtolower(file_get_contents($path)); $path=str_replace("/srv/gopher", "", $path); if (strpos($content, $string) !== false) { $i++; $title = preg_split('#\r?\n#', $content, 2)[0]; $dt=substr($path, 12, 10); echo "0".$dt." ".ucfirst($title)."\t".$path."\t"."spike.nagatha.fr\t70\n"; } } if ($i == 0) echo "No match"; }else{ echo "Empty search string\n\n"; echo "1Return to Phlo\t/phlog\tspike.nagatha.fr\t70\n"; } ?>