$cookie = $_COOKIE['cookie'];
如果cookie未设置,将给我一个错误
PHP ERROR Undefined index: cookie
我如何防止它给我一个空的变量>
isset
if(isset($_COOKIE['cookie'])){ $cookie = $_COOKIE['cookie']; } else{ // Cookie is not set }