How to store a variable in php using session

后端 未结 3 1597
花落未央
花落未央 2020-12-06 18:50

i want to store a value in to session using PHP

for example $id=10 i want to store this value in a session

i tried

$pid= sessi         


        
3条回答
  •  不知归路
    2020-12-06 19:12

    Here is the right code to store the variable in PHP session:

    
    

    Now to get the session data:

    
    

    Also, I have write a complete guide on PHP session on one of my blog: How to start a PHP session, store and accessing Session data?

提交回复
热议问题