Re: multiple table rows into an array, and creating a calendar

From: Date: Wed, 12 Nov 2003 15:18:19 +0000
Subject: Re: multiple table rows into an array, and creating a calendar
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-169278@lists.php.net to get a copy of this message
Dave G wrote:
PHP Gurus,
Why hello young pedawan
I guess what I really am asking is, what is the most efficient way for me to compare the dates on the calendar with the dates in my database and display matches as links.
If you have an array of dates (events) -- and you want to create a calendar where the dates on the calendar are highlighted ... why don't you do an in_array() check for each date that you print. if (in_array($current_cal_date, $array_of_event_dates)) { echo "<td class=\"highlighted\">".$current_cal_date."</td>"; } Hope this helps. -- Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com ----------------------- "Documentation is like sex: when it is good, it is very, very good; and when it is bad, it is better than nothing."

« previous php.general (#169278) next »