Hello,
I have to change a varchar field to a date field.
The varchar field holds a date like: 19-03-02 (dd-mm-jj)
How can use regular expressions to change this field into a date-field Y-m-d ?! Thus: 2002-03-19
Patrick
How about:
// $varchar is what you take out of the dbase $varchar = "19-03-02"; list($dd,$mm,$jj) = explode("-",$varchar); $datefield = "$jj-$mm-$dd" //$datefield is what is put in place of varchar