[PHP] how to control if it is a date
Hi, user can enter a string with following format dd.mm.. Application should transform it to postgresql timestamp date. however, i would like to be sure that what user typed is a real and valid date. how can i do that ? i was thinking to use date(string format, strtotime(string_entered_by_user)); but it does not ensure me that it is a valid date... thx. -- Alain Windows XP SP2 PostgreSQL 8.1.4 Apache 2.0.58 PHP 5
Re: [PHP] how to control if it is a date
On 3/24/07, Alain Roger [EMAIL PROTECTED] wrote: Hi, user can enter a string with following format dd.mm.. Application should transform it to postgresql timestamp date. however, i would like to be sure that what user typed is a real and valid date. how can i do that ? With checkdate i think : http://php.net/checkdate Brice Favre i was thinking to use date(string format, strtotime(string_entered_by_user)); but it does not ensure me that it is a valid date... thx. -- Alain Windows XP SP2 PostgreSQL 8.1.4 Apache 2.0.58 PHP 5
Re: [PHP] how to control if it is a date
thanks i did not know it. On 3/24/07, Brice [EMAIL PROTECTED] wrote: On 3/24/07, Alain Roger [EMAIL PROTECTED] wrote: Hi, user can enter a string with following format dd.mm.. Application should transform it to postgresql timestamp date. however, i would like to be sure that what user typed is a real and valid date. how can i do that ? With checkdate i think : http://php.net/checkdate Brice Favre i was thinking to use date(string format, strtotime(string_entered_by_user)); but it does not ensure me that it is a valid date... thx. -- Alain Windows XP SP2 PostgreSQL 8.1.4 Apache 2.0.58 PHP 5 -- Alain Windows XP SP2 PostgreSQL 8.1.4 Apache 2.0.58 PHP 5