Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在php中获取下个月的名称_Php_Laravel - Fatal编程技术网

如何在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