Php 使用strotime()比较日期是否正确?
我在以下方面有一些问题:Php 使用strotime()比较日期是否正确?,php,Php,我在以下方面有一些问题: <?php echo "an issue by the function strtotime"."<br />"; echo "01-30-2011 ======".strtotime(01-30-2011)."<br />"; echo "01/30/2011 ======".strtotime(01/30/2011)."<br />"; echo "07-01-2011 ======".strtotime(07-01-201
<?php
echo "an issue by the function strtotime"."<br />";
echo "01-30-2011 ======".strtotime(01-30-2011)."<br />";
echo "01/30/2011 ======".strtotime(01/30/2011)."<br />";
echo "07-01-2011 ======".strtotime(07-01-2011)."<br />";
echo "07/01/2011 ======".strtotime(07/01/2011)
?>
问题是您没有提供
strotime()
字符串!首先在这些参数周围加上引号
echo "01-30-2011 ======".strtotime('01-30-2011')."<br />";
echo "01/30/2011 ======".strtotime('01/30/2011')."<br />";
echo "07-01-2011 ======".strtotime('07-01-2011')."<br />";
echo "07/01/2011 ======".strtotime('07/01/2011')
echo“01-30-2011===”.strotime('01-30-2011')。“
”;
echo“01/30/2011==”.strotime('01/30/2011')。“
”;
echo“07-01-2011===”.strotime('07-01-2011')。“
”;
echo“07/01/2011==”.strotime('07/01/2011'))
echo "01-30-2011 ======".strtotime('01-30-2011')."<br />";
echo "01/30/2011 ======".strtotime('01/30/2011')."<br />";
echo "07-01-2011 ======".strtotime('07-01-2011')."<br />";
echo "07/01/2011 ======".strtotime('07/01/2011')