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 的时间来显示用户登录的时间。
设置 cookie:
setcookie("loggood", "YES", $expire, "/", "", 0); setcookie("user", $pid, $expire, "/", "", 0);
任何人都可以帮忙吗?...这可能吗?
谢谢
您可以设置另一个 cookie 或将loggood的值替换为创建用户 id cookie 的时间:
setcookie("loggedin",time(),$expire,"/");
或者 :
setcookie("loggood",time(),$expire,"/");
然后以日期格式回显:
echo date("Y-m-d H:i:s",$_COOKIE['loggedin']);