-
php5 에서 cal_days_in_month 작동 안될때플밍/PHP+MySQL 2011. 8. 29. 05:35php5 에서 cal_days_in_month 작동 안될때
2009/09/07 21:31
//some old php versions don't have cal_days_in_month(), this code accounts for that
if(!function_exists('cal_days_in_month')){
function cal_days_in_month($calendar,$month, $year){
// $calendar just gets ignored, assume gregorian
// calculate number of days in a monthreturn $month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year % 400 ? 28 : 29))) : (($month - 1) % 7 % 2 ? 30 : 31);
}'플밍 > PHP+MySQL' 카테고리의 다른 글
# Comparison Operators (0) 2011.08.29 # Regular Expressions (0) 2011.08.29 ch4. 문자열 조작과 정규표현 (0) 2011.08.29 ch3. 배열 사용 (0) 2011.08.29 ch2. 데이터 저장과 불러오기 (0) 2011.08.29