先上图: 看效果
代码如下:
//类似微信聊天记录 消息发送时间的提示
public function getChatTimeStr($addTime)
{
$nowTime = time();
if ($addTime > $nowTime) {
return "";
}
//返回的时间
$timeStr = "";
//获取当前时间
$addTime = explode(',', date('Y,n,j,w,a,h,i,y', $addTime));//年,月,日,星期,上下午,时,分
$nowTime = explode(',', date('Y,n,j,w,a,h,i,y', $nowTime));
//print_r($addTime);exit;
$dayPerMonthAddTime = self::getDayPerMonth($addTime[0]);
$week = array(0 => "星期日", 1 => "星期一", 2 => "星期二", 3 => "星期三",