如何在php中获取下个月的名称
这是我的密码如何在php中获取下个月的名称,php,laravel,Php,Laravel,这是我的密码 $customer->where(DATE_FORMAT(month,'%m')=date('m',strtotime('+1 month'))); 如何得到下个月的名字,我已经试过了。但是我今天早上出错了 不能在写上下文中使用函数返回值只要这样做,您就可以从这里获得下个月的数据,并在您想要的地方使用它 如果您知道上个月的名称,请使用- $next_month = date('F',strtotime('June next month')); // July 在提问之前
$customer->where(DATE_FORMAT(month,'%m')=date('m',strtotime('+1 month')));
如何得到下个月的名字,我已经试过了。但是我今天早上出错了
不能在写上下文中使用函数返回值只要这样做,您就可以从这里获得下个月的数据,并在您想要的地方使用它 如果您知道上个月的名称,请使用-
$next_month = date('F',strtotime('June next month')); // July
在提问之前,请做些调查。如果你搜索过谷歌,你会得到第一个链接,实际上我的问题是我选择了5个月,我需要显示下个月的名称$customer=DB::table('customer');$customer->join('customer\u month\u calendar'、'customer\u month\u calendar.customer\u id'、'='、'customer.id'、'left');$customer->select('customer.id','customer\u month\u calendar.month');$customer->where(日期\格式(月份,'%m')=日期('m',标准时间('1个月'));$customer->orderBy('customer\u month\u calendar.month','asc');$customer->groupBy('customer.id');返回$customer->get();因此,您需要知道第5个月,并在下一个
之前将其命名。比如:strotime('may next month')
$next_month = date('F',strtotime('June next month')); // July