1.根据当前时间计算N天后的时间 $info = (new DateTime($nowDate))->add(new DateInterval("P{$days}D"))->format('Y-m-d’); 2.根据一个指定的时间获取改天是周几 $weekarray=array("日","一","二","三","四","五","六"); echo "星期".$weekarray[date("w","2015-11-26")]; 3.二维数组排序 $data = array(); $data[] = array('volume' => 67, 'edition' => 2); $data[] = array('volume' => 86, 'edition' => 1); $data[] = array('volume' => 85, 'edition' => 6); $data[] = array('volume' => 98, 'edition' => 2); $data[] = array('volume' => 86, 'edition' => 6); $data[] = array('volume' => 67, 'edition' => 7); // 取得列的列表 foreach ($data as $key => $row) { $volume[$key] = $row['volume']; $edition[$key] = $row['edition']; } array_multisort($volume, SORT_DESC, $edition, SORT_ASC, $data); 4.数组去重去空 $newData = array_unique(array_filter($oldData));
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。