有什么不对的的preg_match错误未知的修饰词 '('
public static function validaDataHoraBR($data_hora){
$pattern = "/^([1-9]|0[1-9]|[1,2][0-9]|3[0,1])/([1-9]|1[0,1,2])/\d{4} ([0-1][0-9]|[2][0-3])(:([0-5][0-9])){1,2}(:([0-5][0-9])){1,2}$/";
return (preg_match($pattern, $data_hora)) ? array(true) : array(false,' não é uma data e hora no formato BR!<br>');
}
这种模式验证这一点 - 20/08/2011 21:00:00
错误:消息:的preg_match()函数在正则表达式未知的修饰 '('
为什么要使用正则表达式来验证日期? [使用'DateTime'类代替](http://stackoverflow.com/a/19271434/1438393)。 –