$dateTime = '2011-10-25 14:08:32';
我想在PHP中显示$dateTime
的日期。为例。2011-10-25是星期二
使用PHP的date()函数
date("l", strtotime($datetime));
$day = date("l", strtotime($dateTime));
或者,您可以使用strftime():
$day = strftime("%A", strtotime($dateTime));
PHP函数中的strftime()等价于C、Perl、GAWK、SQLite等中的同名函数