At 11:03 AM -0300 8/12/09, Martin Scotta wrote:
This is my point of view.
I try to stay the most legible and simple as possible.
@tedd: can you benchmark this script too? usualy legibility > performance
$fridays = array(); # I'll store the friday here
$day = strtotime('-1 month', time() ); # let's start at one month ago
while( 5 != date('w', $day)) # advance to a friday
$day = strtotime('+1 day', $day);
# I'll stop when $day where ahead one month from today
$end = strtotime( '+1 month', time() );
$friday = date('Y-m-d', $day); # store the friday
$day = strtotime('+1 week', $day); # advance one week
} while( $day < $end );
# job's done!
print_r( $friday );
It's included here:
Works great -- thanks.
As Shawn said "Many ways to skin a cat"
As Jeff Foxworthy added "But he ain't going to like any of them!"
http://sperling.com http://ancientstones.com http://earthstones.com
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php