Re: Mktime formatting problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey Rich,

> > 1) read the files from a directory, discard the
> files
> > with a  .php extention and the directories (eg: .
> and
> > .. )
> >
> > 2) put the files into an array ($the_files[])
> >
> > 3) put it into a while loop and display the files
> like
> > so:
> 
> //Only do files over 2 hours old:
> if ((time() - filectime($dir...[$i])) > 60*60*2){
> 
> > echo $the_files[$i] . date("F d Y H:i:s.",
> > filectime($directory_with_files.$the_files[$i]));
> 
> }
> 
> You may need a '/' in there...
> 


Thanks for replying, solved it,  I am using Stuts
suggestion/code (all credit to him) like so:

$threshold = strtotime('-1 hours');
(for or while loop comes here){

if (file_exists($directory_with_files.$the_files[$i]))

	{

		if (filectime($directory_with_files.$the_files[$i])
< $threshold)
			{
			   echo "<b>".$the_files[$i] ." - ". date("F d Y
H:i:s.",
filectime($directory_with_files.$the_files[$i]))."
".$file_time_details[0]."</b><br>";
			}
}

}


And it works perfectly.... if you see anything wrong
with the above or would like to suggest a change, feel
free to tell me, am feeling "brain low" so it is
possible i missed something.

For now I am doing a simple echo, will be changing
that to some manipulation of the files as the project
goes along. One step at a time...

Cheers!
Ryan

------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
-----
Fight back spam! Download the Blue Frog.
http://www.bluesecurity.com/register/s?user=bXVzaWNndTc%3D

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux