Re: [Regular expression] Format string to "DD/MM/YYYY hh:mm"
| From: | Arie Nugraha | Date: | Thu, 30 Mar 2006 13:49:21 +0000 |
| Subject: | Re: [Regular expression] Format string to "DD/MM/YYYY hh:mm" | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-41639@lists.php.net to get a copy of this message | ||
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