In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how php clears the designated session. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
In PHP, you can use the unset () function and the predefined variable "$_ SESSION" to clear the specified session, with the syntax "unset ($_ SESSION ['session name']);".
Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
In php, to clear the specified session is to delete the specified element of the $_ SESSION array
To put it simply, clear the specified session, just like an array, simply unregister an element of the $_ SESSION array.
For example, when you delete $_ SESSION ['name'], you can directly use the unset () function, such as unset ($_ SESSION [' name']);.
The unset () function releases the specified variable in the following syntax format:
Unset (mixed $var [, mixed $...])
Where $var is the variable to be released, and the unset () function can receive multiple parameters, separated by parameters.
Note: when using the unset () function to delete a single Session element, be careful not to omit the specific element name, that is, do not log out the entire $_ SESSION array at once, which may cause unexpected errors.
[example] use the unset () function to delete the specified Session element.
The running results are as follows:
Define a Session As follows: Array ([name] = > [url] = > https://www.yisu.com/ [title] = > Array ([0] = > delete Session [1] = > $_ SESSION)) Delete the element named title in Session: Array ([name] = > [url] = > https://www.yisu.com/) about "how php clears the specified session "that's all for this article. Hope that the above content can be helpful to you, so that you can learn more knowledge, if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.