Re: directory timestamps - limiting by date

From: Date: Tue, 06 Aug 2002 03:57:23 +0000
Subject: Re: directory timestamps - limiting by date
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-111330@lists.php.net to get a copy of this message
On Tuesday 06 August 2002 11:36, Diver8 wrote: > hey thanks a bunch for the quick reply & helpful > pointer! i'll admit though, while i do want to do this > myself, i am slightly confused by parts of what you've > posted.... i'm just getting started with php, so i > guess a lot of things don't make sense yet (but i am > trying!).... here's the code i've come up with so > far: > > <?php > $directory = './xyz'; > function get_last_modified($directory) { > $mtime = 0; > $fp = opendir("$directory"); > while (($fname = readdir($fp)) !== false) { > $new_mtime = $mtime("$directory" + "$fname"); > if ($new_mtime > $mtime) then ($mtime = > $new_mtime); > } #end while > if now - mtime < 30 day { > return time2string(mtime); > else > return "" > end function > ?> > > from the 'end while' bit down, i'm lost. i don't see > anything about 'end while', end while is a comment (note it is preceeded by #) > 'now', now is a pseudo-name for a function which returns the current time (look at the date-time functions in the manual for the exact function). > or 'time2string' in time2string is a pseudo-name for a function which returns a string in a human readable format (eg 12th May 2002 3:15pm) representing the given time. Look at the date-time functions in the manual for the exact function. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* The Heineken Uncertainty Principle: You can never be sure how many beers you had last night. */

« previous php.general (#111330) next »