strtotime问题
各位大大
我想得到一个循环,就是根据目前的日期,每循环一次就自减一天,比如
- PHP code
<!---ecms Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->for($i=0;$i<10;$i++){ $current_date=date("Y-m-d", strtotime("-$i day"));}
这样好像不行啊!
我想自动生成一个当前日期,方便在数据库里根据日期查数据。
或者各位有没有别的什么办法?
谢谢!
——解决方案——————–
- PHP code
/*没什么问题2012-02-282012-02-272来2源gaodaima#com搞(代@码&网012-02-262012-02-252012-02-242012-02-232012-02-222012-02-212012-02-202012-02-19*/for($i=0;$i<10;$i++){ $current_date=date("Y-m-d", strtotime("-$i day")); echo $current_date.'
';}