PHP原生態記錄Log函式

2021-07-11 04:50:29 字數 526 閱讀 6257

1、因為專案已經上線了,所以除錯起來就不可能把報錯直接輸出來,寫了乙個簡單的日誌函式如下: //

$log要新增的字串、$fileprefix 日誌名$filesuffix 日誌字尾$time預設為day

function addlog($log='',$fileprefix='',$filesuffix='.log',$time='day')elseif($time=='month')elseif($time=='hour')elseif($time=='minute')elseif($time=='second')else

$filename=$fileprefix.$period.$filesuffix;

$fp=fopen($filename,'a');

if($fp)else

}else

}else

}//要寫入資料庫的字串

$str ='88888';

addlog($str,'erdangjiade');exit;

php原生態驗證碼

頭部輸出 header content type image png 建立資源 im imagecreatetruecolor 100,50 建立顏色 black imagecolorallocate im,0,0,0 white imagecolorallocate im,255,255,255 ...

php原生態驗證碼

開啟session session start 生成隨機字串 注 字串的取值可以使用陣列取值方式 function random len return code 呼叫生成隨機字串 verification random 4 頭部輸出 header content type image png 定義寬...

Python原生態函式小結

最近疫情大爆發,簡歷投出去基本上沒什麼反應,閒著也是閒著還不如鞏固一下以前的知識 1 字串可以是單引號 雙引號 一般一行以內,當然也可以使用 三引號 多行 單引號和雙引號可以互用 c it is a dog str.strip 去除字串裡面的 號 str.split 對字串按照,進行分割 zip l...