$dates[]=date('D',strtotime($date)); code example
Example 1: strtotime format
$date = '25/05/2010';
$date = str_replace('/', '-', $date);
echo date('Y-m-d', strtotime($date));
Example 2: php date strtotime format
$date = '25/05/2010';
$date = str_replace('/', '-', $date);
echo date('Y-m-d', strtotime($date));