PHP学习(七) $_SESSION
程序员文章站
2024-03-20 13:46:58
...
<?php
session_start();
header('Content-Type:text/plain;charset=utf-8');
if(isset($_SESSION['views']))
{
$_SESSION['views']=$_SESSION['views']+1;
}
else
{
$_SESSION['views']=1;
}
echo "浏览量:". $_SESSION['views'];
?>
效果图(刷新页面):
上一篇: 设置cookie,删除cookie,读取cookie
下一篇: cookies