how to get date of yesterday using php?

前端 未结 9 1555
悲&欢浪女
悲&欢浪女 2021-01-30 04:51

I want to get the yesterday date using specific date format in php this is the format:

$today = date(\"d.m.Y\"); //15.04.2013

Is it possible?

9条回答
  •  后悔当初
    2021-01-30 05:19

    you can do this by

    date("F j, Y", time() - 60 * 60 * 24);
    

    or by

    date("F j, Y", strtotime("yesterday"));
    

提交回复
热议问题