regex to check date format php
snippet in php

regex to check date format php

user1263

if (preg_match("/\d{4}\-\d{2}-\d{2}/", $date)) {
    echo 'true';
} else {
    echo 'false';
}