Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前正在尝试找出日期是否为YYYY-DD-MM.
YYYY-DD-MM
在 PHP 中,我有这个:
if (preg_match('(\d{4})(-)(\d{2})(-)(\d{2})$', $newDateOfBirth))
但是我不断收到以下错误:
警告:preg_match(): Unknown modifier '(' in C:\webserver\webroot\index.php 第 105 行
您缺少分隔符:
if (preg_match('~(\d{4})(-)(\d{2})(-)(\d{2})$~', $newDateOfBirth))