php检查是否为一个合法的时间格式正则
下面总结了几种利用php来验证用户输入的日期是不是正确的日期哦,有需要的朋友可参考参考。
checkdate() 函数验证一个格里高里日期。
例子
代码如下 | 复制代码 |
var_dump(checkdate(12,31,2000)); bool(true) |
正则日期
例1
/**
代码如下 | 复制代码 |
* 检查是否为一个合法的时间格式 return preg_match($pattern, $time); |
例2
正则验证日期
代码如下 | 复制代码 |
$reg="/d{4}-d{2}-d{2}/"; |

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SublimeText3 Chinese version
Chinese version, very easy to use

Dreamweaver CS6
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

WebStorm Mac version
Useful JavaScript development tools
