執行 ❯
獲取您
自己的 PHP
伺服器
×
更改方向
更改主題,深色/淺色
前往 Spaces
<!DOCTYPE html> <?php $value = "Hello world!"; // cookie will expire when the browser closes setcookie("myCookie", $value); // cookie will expire in 1 hour setcookie("myCookie", $value, time()+3600); // cookie will expire in 1 hour, and will only be available // within the php directory + all sub-directories of php setcookie("myCookie", $value, time()+3600, "/php/"); ?> <html> <body> </body> </html>