$year = $date[6].$date[7].$date[8].$date[9]; $month = $date[0].$date[1]; $day = $date[3].$date[4]; $newDate = $year."-".$month."-".$day;