I have a bit of regex code....
for dates that are formatted as for example, Aug 14, 2010, it will output...
$haveDate0[year]
$haveDate0[month]
$haveDate0[day]
but if the date is formatted as Aug 4, 2010... the day not being a two digit number... not starting with a zero... then the regex does't recognize anything.
is there a simple way to update my regex so it recognizes both 1 and 2 digit days?
Code:
preg_match('#(?P<month>\w+) (?P<day>\d+) (?P<year>\d+)#', $dataAB[0], $haveDate0);
for dates that are formatted as for example, Aug 14, 2010, it will output...
$haveDate0[year]
$haveDate0[month]
$haveDate0[day]
but if the date is formatted as Aug 4, 2010... the day not being a two digit number... not starting with a zero... then the regex does't recognize anything.
is there a simple way to update my regex so it recognizes both 1 and 2 digit days?