for($day=0; $day<7;$day++) { // $day[0] is mon; $day[1] is tues; ... foreach($avail[$day] as $av) { //do your calculation here } }
Jason Dulberg wrote:
Thank you for the response. I am not quite sure how that works, can you please give an example?
Thanks.
Jason
-----Original Message----- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: May 27, 2003 8:13 AM To: Jason Dulberg Cc: [EMAIL PROTECTED] Subject: Re: [PHP] daily availability chart array
Use weekdays' numbers instead of the short format, then you need only 2 nested loops
Jason Dulberg wrote:
I need to create a daily availability chart and currently am usingMy problem
multidimensional arrays to assign which day/timeslot is chosen.
is that in doing so, I have to create 7 "foreach" statements togo through
each of the days to pick out the timeslot values.comparison
ie. avail[mon][1] (morning) avail[tues][2] (afternoon) avail[wed][4] (evening) avail[thurs][8] (night) etc. (the above data is taken from a user input form, user can choose 1 or all timeslots)
I need to loop through these values for bitwise calculation and
to a mysql db field. The user can have multiple choices in thesame day so
the obtained bit values would have to be added accordingly.
Is there any way to get around using 7 loops to create the bit value?
Any suggestions are greatly appreciated!
Jason
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php