Just wandering, will it be possible to make the system always read the latest updated csv file with php??
Exmaple: I have a folder \'Report\'; user will put in the new c
You can use the filemtime() function in php. Here is the manual page:
http://php.net/manual/en/function.filemtime.php
You just need to get a list of a all files in the directory.
This should fine the file with the "highest" modification time (meaning the last modified file). You can use filemtime for this.
$dir = "dir/to/check/";
$dh = opendir($dir);
$last = 0;
$name = "";
while (($file = readdir($dh)) !== false){
if(is_file($dir.$file)){
$mt = filemtime($dir.$file);
if($mt > $last){
$last = $mt;
$name = $file;
}
}
}
closedir($dh);
echo "Last modified file: $name";