TAILIEUCHUNG - Thiết kế mạng xã hội với PHP - 29

Tham khảo tài liệu 'thiết kế mạng xã hội với php - 29', công nghệ thông tin, đồ họa - thiết kế - flash phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Events and Birthdays increment and loop start days done this- dates cal_dates this- dateStyles cal_dates_style this- dateData cal_dates_data Days in the month Calculating the days in a month is a fairly simple task all months have a set number of days in them except for February so for February we simply need to check whether the current year is a leap year How many days are in a month @param int m month @param int y year return int the number of days in the month function daysInMonth m y If we have been passed a month that isn t valid simply return zero if m 1 m 12 return 0 else September April June and November have 30 days so for these months return 30 30 9 4 6 11 if m 9 m 4 m 6 m 11 return 30 262 Download from Wow eBook Chapter 9 For any remaining month that isn t February all the rest have 31 we return 31 else if m 2 all the rest have 31 return 31 else A year isn t a leap year if the year isn t divisible by 4 so in this instance we return 28 except for february alone if y 4 0 which has 28 return 28 else If a year isn t divisible by 100 then it is a leap year so we return 29 if y 100 0 and on leap years 29 return 29 else If the year isn t divisible by 400 then it isn t a leap year so we return 28 if y 400 0 deja vu which has 28 return 28 else 263 Download from Wow eBook Events and Birthdays If it is divisible by 400 then we return 29 as it is a leap year deja vu and on leap years 29 return 29 And there we have a very handy function as part of our calendar library to determine the number of days in any given month. Ordered days As discussed earlier our calendar is set to be customizable in terms of which day of the month is the start date. Because of this our array of days private days ar ray Sun Mon Tue Wed Thu Fri Sat needs to be re-ordered based on the chosen first day of the week Get days in order return array array of days as strings function getDaysInOrder ordered_days array for i 0 i 7 i ordered_days this- days this- .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.