PHP正則照合日
/**
* xxxx-xx-xx
*/
public function regular()
{
$rules = '/^(\d{4}-\d{2}-\d{2})?$/';
$pattern = '/^\d{4}-\d{2}-\d{2}$/'; //
$val = '2018-08-08';
if(preg_match($rules,$val)){
echo ' ';
}else{
echo ' ';
}
}