date('Y-m-d H:i:s', strtotime('-1 day'));strrev()、implode('', array_reverse(str_split($str)))、遞歸實現。NOW()、CURRENT_TIMESTAMP;格式化:DATE_FORMAT()mb_substr($str, 0, 10, 'utf-8') 或 mb_strimwidth()$_SERVER['REMOTE_ADDR']、$_SERVER['SERVER_ADDR'](注意代理情況下的 HTTP_X_FORWARDED_FOR)。include_once/require_once 防止重復包含。session.gc_maxlifetime、session_set_cookie_params()、自定義存儲處理器。file_get_contents()、cURL、fopen() + stream_get_contents()。header('HTTP/1.1 404 Not Found');SELECT username FROM members ORDER BY posts DESC LIMIT 10;&;大數據、需修改原值時用引用,否則傳值更安全。E_ALL & ~E_NOTICE。filter_var($email, FILTER_VALIDATE_EMAIL) 或正則 /^[\w\-\.]+@[\w\-]+(\.[\w\-]+)+$/。$_SERVER['SCRIPT_FILENAME']、$_SERVER['REQUEST_URI']、$_GET/$_POST。$num 為局部變量,外部 $num 不變,輸出 10。array_add() 不存在,正確為 $users[]、array_push()、$users ||= 'john'(錯誤寫法)。fopen() 正確,其餘函數不存在。$_SERVER['SCRIPT_NAME'];引薦頁面:$_SERVER['HTTP_REFERER']error_reporting(2047) 開啟所有錯誤報告(E_ALL=2047)。phptype://user:pass@host/dbname/