php验证是否日期格式代码 验证日期格式函数分享
2015-04-16 14:08
验证日期格式:YYYY-MM-DD
函数如下需要的拿去哦:
- function checkDateFormat($date) {
- // match the format of the date
- if (preg_match("/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/", $date, $parts)) {
- // check whether the date is valid of not
- if (checkdate($parts[2], $parts[3], $parts[1])) {
- return true;
- } else {
- return false;
- }
- } else {
- return false;
- }
- }
【责任编辑:小戴工程师】
上一篇:iis6.1访问asp和aspx出现404.3 iis6.1无法访问asp解决办法 下一篇:如何批量去掉teleport pro软件的tppabs冗余代码最新文章
2015-04-16 14:08
相关文章
2015-04-16 14:08