This question already has an answer here:
What's wrong with this?
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>');
}
This pattern validate this - 20/08/2011 21:00:00
Error: Message: preg_match() [function.preg-match]: Unknown modifier '('
</div>