PHP:$_GET[]、$_POST[]下标问题

在使用$_GET[]或$_POST[]时,有时会提示  Notice : Undefined index:  的警告。

使用下面这种方法会非常容易解决此问题:

$var = isset($_GET['username']) ? $_GET['username': null; 

转载于:https://www.cnblogs.com/rainman/archive/2009/11/17/1604863.html

猜你喜欢

转载自blog.csdn.net/weixin_34232363/article/details/93561263