or you can try...
if (ereg("([0-9]{2}[.]([0-9]{2}[.]([0-9]{2,4})", $oldformat, $regs))
{
$month = $regs[1];
$day = $regs[2];
$year = $regs[3];
if ($year < 10) {$year .+ 2000; }
else if ($year < 100) { $year .+ 1900; }
echo "$year-$month-$day";
}
else { echo "Date: $oldformat - Does not match mm-dd-yy(yy)<br>\n"; }
didnt test this, but from all the eregs I did last night... the pattern looks right... and the $year check seems like a valid way of disserning 2 or 4 format....
03 is less than 10 so 2003, 50 is higher then 10 but less than 100 so, 1950....
could very well be the hard way of doing things, but thats how first came to mind 🙂