参数传进来是"2010-04-08 2001:25"格式,怎么控制这个格式,如果不是这种样式传进来的就提示格式错误呢?
解决方案 »
- 关于加密算法3DES 的key,iv问题
- 救命~(要怎样 部署本地php的运行环境…)
- 文件上传问题 第一次做 不是很明白 ^ M ^
- fckeditor编辑器 默认居中对齐?
- 求一条三表关联的SQL语句
- 怎样做这个添加好友的功能
- 用php写IC卡读写程序
- 怎么添加2条数据到数据库
- include的文件中如何定位所链接的图片
- 帮我看看是什么出错,好吗?Fatal error: Maximum execution time of 30 seconds exceeded in G:\supermarket\SearchHeTong.php on line 186
- 请教magento 的学习资料
- 关于用mail()发邮件的问题
$sString = "1985-04-08 2001:25";
$sPattern = "/\d{4}[-]\d{2}[-]\d{2}\s*\d{4}[:]\d{2}/i";
preg_match($sPattern, $sString, $aMatch);
print_r($aMatch);
$sPattern = "/\b\d{4}[-]\d{2}[-]\d{2}\s*\d{2}[:]\d{2}\b/i";
preg_match($sPattern, $sString, $aMatch);
print_r($aMatch);