今天在弄日历,wamp总是提示:Notice: Undefined index 之类的……
查找原因,原来是页面在初始状态,没有赋与 $_GET['month']值,想到
服务器配置修改
修改php.ini配置文件,error_reporting = E_ALL & ~E_NOTICE但是当PHP重装或系统迁移的时候,又需要重新配置。
于是想到了:
function _get($str){$val = !empty($_GET[$str]) ? $_GET[$str] : null;return $val;}