【发布时间】:2016-11-01 07:57:25
【问题描述】:
它应该是空白的。我怎样才能防止这种情况发生? 我正在使用此代码显示日期
public function bookedOn($chalet_id) {
$chalet = \App\Chalet::where('chalet_id', '=', $chalet_id)->get();
if ($chalet->count() > 0) {
$books = \App\EventBookings::where('chalet_id', '=', $chalet[0]->chalet_id)->value('created_at');
$str = date('M. d, Y',strtotime($books));
return $str;
} else {
return false;
}
}
我认为我需要在这里做一些事情:
$str = date('M.d, Y',strtotime($books));
【问题讨论】:
标签: php