Hi,
I am makin a sort of document management system.
and are trying to solve some smal problems.
Here is a quick overview of the functions
Info/data is stored in a database, and the files is on the filesystem.
the filestrings comes from the db colum, but they have no extension, eg. f856843, d86845, e764533 ...
and therefor the colum don't know what fileformat it is.
This is my solution today:
make the query,
open the filefolder
loop through the files in the filefolder
in the loop explode the filestring (find the . )
and do a check on the db colum == $filestring[0]
print the files found.
here is the code ($theFile is the db colum)
if ($dir = @opendir("./")) {
while (($file = readdir($dir)) !== false) {
$foo = explode(".", $file);
if ($theFile == $foo[0]) {
echo $file."<br>\n";
}
}
closedir($dir);
}
is there a faster way to do this.
thanks in advance,
regards Thomas A