如果日期是'03_01_12'
和'31_12_11'
格式,如何在php中比较两个日期。
我使用的是以下代码:
$date1=date('d_m_y');
$date2='31_12_11';
if(strtotime($date1) < strtotime($date2))
echo '1 is small ='.strtotime($date1).','.$date1;
else
echo '2 is small ='.strtotime($date2).','.$date2;
但是它不起作用..
https://stackoverflow.com/questions/8722806
复制相似问题