Date: 12/01/07 (PHP Community) Keywords: no keywords This looks repetitive, anyway to make it better? if (!empty ($arr_bits[2])) { $this->minTimeStamp = mktime (0, 0, 0, $arr_bits[1], $arr_bits[2], $arr_bits[0]); $this->maxTimeStamp = mktime (23, 59, 59, $arr_bits[1], $arr_bits[2], $arr_bits[0]); // If there's no day but there is a month, get the first and last second of the month } elseif (!empty ($arr_bits[1])) { $this->minTimeStamp = mktime (0, 0, 0, $arr_bits[1], 1, $arr_bits[0]); $this->maxTimeStamp = mktime (23, 59, 59, $arr_bits[1], date ('t', $min_timestamp), $arr_bits[0]); } elseif (!empty ($arr_bits[0])) { $this->minTimeStamp = mktime (0, 0, 0, 1, 1, $arr_bits[0]); $this->maxTimeStamp = mktime (23, 59, 59, 12, 31, $arr_bits[0]); } Thanks ^^;;
|