Showing posts with label files. Show all posts
Showing posts with label files. Show all posts

Monday, 26 December 2011

Sorting files with php


This function will sort files in the directory passed as arguments by the last modified or created time
function sortFilesByDate($dirname)
{
clearstatcache();
$files = array();
if ($handle = opendir($dirname))
{
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..")
{
$files[filemtime($dirname."/".$file)] = $file;
}
}
closedir($handle);
}
// sort
ksort($files);
end($files);
$tot = count($files);
$i = 0;
$EXITSTR = "";
while ($tot != $i)
{
$EXITSTR = $EXITSTR . current($files);
prev($files);
$i ++;
$EXITSTR = $EXITSTR . "<br/>";
}

 

return $EXITSTR;
}

Reset numbering for Screenshots Win+PrtSc

I was using today the screen shot functionality of Windows 8.1 Win Key + PrtSc How to reset the numbering?