|
Posted by Sonnich on 10/31/06 11:22
Hi all
I use the opendir and readdir to search for files... but they read in
all files, so sometimes I get several hundreds.
If there is a way to give a wildcard, it might be a lot faster.
Since I do this search 100+ times at certain times, this is the thing
which slows me down.
Disableing this part speeds my code up by 90%.
Any ideas?
Sonnich
if($handle = opendir($sSearchPath))
{
while (false !== ($file = readdir($handle)))
{
$file2 = strtoupper($file);
if( (strpos($file2, $code)!==False) && (strpos($file2,
".PDF")!==False))
{
$files[] = $file;
$paths[] = $sSearchPath;
}
}
closedir($handle);
}
Navigation:
[Reply to this message]
|