Have a look at:
http://www.php.net/opendir
There is a nice example there of reading directory contents.
If you want to gather the contents of that directory and put it in a txt file, then also have a look at PHP's filesystem functions:
http://www.php.net/manual/en/ref.filesystem.php
<?php
// directory information gathered here.. see opendir() function
$file = fopen("C:\\dir_output.txt", 'w');
if (false === ($bytes = fwrite($file, $dir_stuff)))
{
echo 'error: unable to write to file, check file permissions.';
}
else
{
echo 'File containing '.$bytes.' BYTES created.';
}
?>
hth,
Rich
:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::