How could I take this code and output the result to a txt file on the server?
code:
<?php
$maindir = "." ;
$mydir = opendir($maindir) ;
$exclude = array( "index.php") ;
while($fn = readdir($mydir)) { if ($fn == $exclude[0] || $fn == $exclude[1]) continue;
echo "<br><a href='$fn'>$fn</a>"; } closedir($mydir);
?>
What it does is it lists all the files in that folder that the indexer.php is in.
So how would I take that list and put it in a txt file?
If any one knows of a simpler or better way of outputting all the file names and the links to them in a txt file on the server please feel free to post it.