Answers for "how to validate date in php"

PHP
1

regex to check date format php

if (preg_match("/\d{4}\-\d{2}-\d{2}/", $date)) {
    echo 'true';
} else {
    echo 'false';
}
Posted by: Guest on March-23-2020

Browse Popular Code Answers by Language