Quote:
Originally Posted by Dido AskJolene
With regards to the date splitting, using a regexp is ok - however I think just using explode() will/can be quicker. Especially for something this trivial, it doesn't really require a regexp.
|
That works really well too. From what I understand it's much quicker to use PHP native functions than a regex anyhow? This is what I came up with...
Code:
$oldDate = "1/12/2011";
list ($day, $month, $year) = explode("/", $oldDate);
$newDate = "$year-$day-$month";
Does the trick. Thnx.
