www.php.net has plenty of documentation...
www.hotscripts.com is just one of many, many sites that offer PHP scripts...
If you're working with flat files, get comfortable with the fopen(), fputs(), fputss(), opendir(), readdir() functions, to name just a few.
Have fun...