1$dayofweek = date('w', strtotime($date));
2$result = date('Y-m-d', strtotime(($day - $dayofweek).' day', strtotime($date)));
1$datetime = DateTime::createFromFormat('YmdHi', '201308131830');
2echo $datetime->format('D');
3
4// or
5
6$date = new \DateTime();
7echo $date->format("D");
8
9