array_search help in condition statement
Posted: Fri Sep 12, 2003 6:48 am
i have this code
I have an Array called $days_off. This contains any numbers between 1 and 366, corresponding do what days people have got booked off work.
I am doing this array search against the number of the current day to see if anyone has a day of on this day.
The array_search returns the key of the Array where a match occurrs, but when the key is 0 the statment is false.
How can i can round this?
Mark
Code: Select all
if (($key = array_search(date("z", mktime(0,0,0,9,$september,$year)), $days_off))) {
// Do something
}I am doing this array search against the number of the current day to see if anyone has a day of on this day.
The array_search returns the key of the Array where a match occurrs, but when the key is 0 the statment is false.
How can i can round this?
Mark