-
Grab File Loop
Hi,
I need to write a script that will do the following ASAP:
- look in a spacific directory
- take the first file, include it into a file and do something with the varibles inside
- repeat with the next file
- keep doing this until it has run-out of files
Ideas? Suggetions?
Thanks in advance,
Dan
-
SCRAP THAT!
Got a better solution now anyways!
-
Assuming you have a variant of PHP 5, you could use SPL.
PHP Code:
<?php
foreach(new DirectoryIterator('/path/of/your/choice/') as $oFile)
{
if($oFile->isFile())
{
include(realpath($oFile->getPathname()));
/*
Do stuff with included vars.
*/
}
}
?>
:)