Hi, i am trying to "write" current dir to a .html file (just the name of files).
I already "print" the content of dir on screen, but i want to save it to a file.
Here is the code:
<?
// List content of a dir
function list_dir($dir){
$theDirectory = dir($dir);
echo "<table align=center>\n";
while($entryName = $theDirectory->read())
{
if($entryName!="." and $entryName!=".." and $entryName!="index.php")
{
$entryName = str_replace("paut", "", $entryName);
$entryName = str_replace(".zip", "", $entryName);
echo "<tr>\n<td><a href=$entryName>$entryName</a></td>\n</tr>\n";
}
}
echo "</table>";
$theDirectory->close();
}
list_dir(".");
?>
Thanx in advance