On Friday, May 20, 2011, João Cândido de Souza Neto wrote:

> What about using regular expression to validate so using DateTime
> object to  parse it if it?s a valid date?

Again, thanks.

For info, I only need to know that it's a valid representation of a
date on this occasion as I intend to use the MySQL CAST function to do
the actual conversion within the INSERT or UPDATE SQL statement that
commits the value to the underlying database.

I strongly suspect that you're correct in that I should be able to use
a regexp to do the validation. This could well be the catalyst that
gets my sleeves rolled up, a large pot of strong, black coffee on the
hob, and me finally trying that little bit harder to get my head
around regular expressions!

I was hoping that PHP would have an equivalent to VBScript's IsDate()
function but it looks like I'll have to roll my own!

Thanks again,

-- 
Geoff


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

Reply via email to