how can I get last week' date range in php?

后端 未结 12 1329
轻奢々
轻奢々 2020-12-23 23:23

how can I get last week\' date range in php ?

see my codes bellow:



        
12条回答
  •  忘掉有多难
    2020-12-23 23:43

    You can do this way.

    First get the current timestamp and subtract the no.of days you want.

    $curTime = time();
    echo date("Y-m-d",$curTime);
    echo "
    "; echo date("Y-m-d",($curTime-(60*60*24*7)));

提交回复
热议问题