On Mon, October 9, 2006 11:26 am, Ron Piggott (PHP) wrote:
> Is there a PHP function which verifies a valid date has been entered
> (-MM-DD)? Ron
Note that both solutions so far are only partial solutions for most
real world scenarios.
For example:
0001-12-25
will pass both, and would appear
Ron Piggott (PHP) wrote:
Is there a PHP function which verifies a valid date has been entered
(-MM-DD)? Ron
http://www.php.net/manual/en/function.checkdate.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Ron Piggott (PHP) wrote:
Is there a PHP function which verifies a valid date has been entered
(-MM-DD)? Ron
preg_match('/^(\d{4})-(\d\d)-(\d\d)\z/', $s, $m) && checkdate($m[2],
$m[3], $m[1])
Arpad
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php
Is there a PHP function which verifies a valid date has been entered
(-MM-DD)? Ron
4 matches
Mail list logo