Re: [Regular expression] Format string to "DD/MM/YYYY hh:mm"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



try this :

$date = "30/12/1982 15:30"

if (preg_match("/\d{2}\/\d{2}\/\d{4}\s\d{2}:\d{2}/i",$date )) {
    echo "Date is valid";
} else {
    echo "Date NOT valid";
}

hope it will help you

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux