I have some problems with the following:
<?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)
?>
The result is an issue by the function strtotime:
01-30-2011 ======1310059868
01/30/2011 ======
07-01-2011 ======1310057768
07/01/2011 ======
- Whi开发者_开发知识库ch format is right to give argument to the function strtotime()?
- Why is the epoch value changing during the page refresh, even though the argument isn't changed?
The problem is that you aren't giving strtotime()
strings! Put quotes around those parameters first.
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')
精彩评论