在 PHP 中验证日期
谁能教我一个函数或脚本或一些相关示例,其中只允许输入天数?我有一个日期选择器用于选择日期开始和日期结束...我只希望用户在指定的时间/日期范围内输入,如果用户重叠,它会提示用户只能从某个范围内输入的时间。
前任。我只允许28天。
场景 1:
Date from: 2011-09-01
Date to: 2011-09-31
Result: (prompt) you are only allowed to input within 28 days.
场景 2:
Date from: 2011-09-01
Date to: 2011-09-20
Result: it will proceed to another page.
can anyone taught me a function or a script or some related example where in it would only allow number of days to be inputted? I have a datepicker for choosing the date start and date end... I only want the user to input within a specified range of time/date and if the user overlaps, it will prompt the user that they could only input from a certain range of time.
Ex. I would only allow 28 days.
Scenario1:
Date from: 2011-09-01
Date to: 2011-09-31
Result: (prompt) you are only allowed to input within 28 days.
Scenario2:
Date from: 2011-09-01
Date to: 2011-09-20
Result: it will proceed to another page.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您有 >= PHP 5.3...
If you have >= PHP 5.3...