Posted by serkanhamarat@gmail.com on 11/02/06 23:24
Hope I understood and it helps;
1st STEP:
You need a recursive function for subdirectory handling.
recursive function means "a function calls himself" in a loop.
usually an infinite loop but not here. search for similar algorythims
to handle every subdirectories one by one.
"
function recursive_func($basedir) {
$handle =opendir($basedir);
while ($file = readdir($handle)) {
do your compare and other stuff here;
if (is_dir($file)) {
recursive_func($file);
}
}
}
2nd STEP:
use a regular expression for keyword search in file names for
comparison.
use like ereg() or eregi() functions. they explained in references.
"if (ereg("key", $filename)) { print "<a>form your URL here</a>"; }"
esarch better examples.
Navigation:
[Reply to this message]
|