Create a gist now

Instantly share code, notes, and snippets.

クッキーにセットした値をカウントアップします。
<?php
if( isset($_COOKIE['count']) ){
$count = $_COOKIE['count'];
} else {
$count = 0;
}
$count++;
setcookie('count', $count);
?><!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<?php echo($count); ?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment