09/10/2018, 18:17

Hàm kiểm tra dữ liệu nhập vào kiểu Date/Time trong PHP

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
jiSh@n viết 20:21 ngày 09/10/2018
Chă'c là ..... if .... else wa' . Bạn thử mở Manual ra xem phần Date/Time đi.
Bim viết 20:33 ngày 09/10/2018
Kiểm tra? Dữ liệp nhập thế nào chứ?
timtoi2001 viết 20:18 ngày 09/10/2018
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
HoiAmNhac viết 20:19 ngày 09/10/2018
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()
Bim viết 20:21 ngày 09/10/2018
Hix, lỡ nó chọn ngày 30-2 thì sao huh? Cái đó còn đỡ, lỡ 29-2?
Bài liên quan
0