Các đại ca cho mình hỏi trong PHP hàm kiểm tra dữ liệu nhập vào kiểu Date/Time là hàm gì vậy?
Xin cám ơn
Các đại ca cho mình hỏi trong PHP hàm kiểm tra dữ liệu nhập vào kiểu Date/Time là hàm gì vậy?
Xin cám ơn
Chă'c là ..... if .... else wa' . Bạn thử mở Manual ra xem phần Date/Time đi.
Kiểm tra? Dữ liệp nhập thế nào chứ?
Tức là khi người nhập dữ liệu sai định dạng ngày tháng năm thì không cho Update vào CSDL
You will have got 3 forms, it used to input: date, month and year!
Validate a date/time
int checkdate (int month, int day, int year)
Returns true if the date given is valid; otherwise returns false. Checks the validity of the date formed by the
arguments. A date is considered valid if:
• year is between 0 and 32767 inclusive
• month is between 1 and 12 inclusive
• Dayis within the allowed number of days for the given month. Leap years are taken into consideration.
Or Compare it with time()
Hix, lỡ nó chọn ngày 30-2 thì sao huh? Cái đó còn đỡ, lỡ 29-2?
Bookmarks