<?php $n=date('Y-m-d');$reg="/([0-9]{4})-(0[1-9]|1[0,1,2])-(0[1-9]|1[0-9]|2[0-9]|3[01])/";var_dump(preg_match($reg, $n));
Standard input is empty
int(1)
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!