You are here: Re: Question from php cookbook « PHP Programming Language « IT news, forums, messages
Re: Question from php cookbook

Posted by Chung Leong on 10/21/67 11:34

Mike wrote:
> I wrote:"I dont understand what the $yesterday and $day_secs are for?"
> What do those 2 variables have to do with creating the calendar???
> This is why I refered to the book.

The conversions to Unix timestamp is done presumbly so to make it
easier to determine whether the days shown are in the past or in the
future. Instead of comparing three numbers--the year, the month, and
the day--you compare just one. The strategy just ends up complicating
the code. It'd easy enough to do this:

if($year < $today_year || $month < $today_month || $day < $today_day) {
/* days in the past */
}
else if($year > $today_year || $month > $today_month || $day >
$today_day) {
/* days in the future */
}
else {
/* today */
}

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация