【发布时间】:2012-01-04 06:18:56
【问题描述】:
如果日期格式为 '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;
但它不起作用..
【问题讨论】:
标签: php