首页 > 代码库 > php session

php session

<?php
    session_start();
    
    if(isset($_SESSION[‘view‘])){
        $_SESSION[‘view‘] = $_SESSION[‘view‘] + 1;
    }else{
        $_SESSION[‘view‘] = 0;
    
    }
?>
<!DOCTYPE HTML>
<html>
    <head>
        <title>session</title>
    </head>
    <body>
        <?php
            echo $_SESSION[‘view‘];
        ?>
    </body>
</html>

<?php
//    unset($_SESSION[‘view‘]);
//    session_destroy();
?>

 

php session