PHP 記錄

  1. PHP 修改 php.ini 配置  函數  ini_set();
  2. PHP 防注入函數 mysql_real_escape_string
  3. redis 數據類型 : 字符串、哈希、枚舉、列表、有序列表
  4. return mb_convert_encoding(mb_convert_encoding($content, "GBK", "UTF-8"), "UTF-8", "GBK"); 過濾表情
    
  5. 計算兩個時間段的每天的日期
             $stimestamp = strtotime($startdate);
            $etimestamp = strtotime($enddate);
            if ($etimestamp < $stimestamp) return [];
            // 計算日期段內有多少天
            $days = (int)ceil(($etimestamp - $stimestamp) / 86400);
            // 保存每天日期
            $date = array();
            for ($i = 0; $i < $days; $i++) {
                $date[] = date('Y-m-d', $stimestamp + (86400 * $i));
            }
    
            return $date;

    本週時間開始  date('Y-m-d', strtotime('this week'))

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章