Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图通过简单地调用它在数组中的索引位置来检索 cookie 的值,即 1。但是,我收到一条错误消息,说 1 是未定义的偏移量?当我知道一个事实时,它处于位置 1。我错过了什么吗?
$query = "SELECT * FROM basketID" . $_COOKIE[1];
我已经像这样设置了cookie
setcookie('visitUid',$uid,time()+60*60*24*7, '/');
$uid 是一个随机生成的数字。
$_COOKIE['visitUid']是你要找的
$_COOKIE['visitUid']