![]() |
|
PHP Session and Variable Handling Functions. Free online PHP and MySQL Web Database Programming Tutorial... |
| Lessons | PHP Session and Variable Handling Functions |
|
|
Session-Handling Functions Session handling is a way of perserving or persisting the session data of a user as a he / she navigates our Web site. The session data could be variables or objects. session_start() The session_start() function denotes the start a session if one has not already been started, or it resumes a session if there already exists a session. This function is argumentless i.e. it takes no arguments. This function has to be called at the beginning of the PHP script. Its syntax follows: session_start(); session_destroy() We use the session_destroy() function to destroy all the variables and other data associated with a user session. This functin is also argumentless and takes no arguments. Its syntax follows: session_destroy(); Variable Handling Functions Variable handling functions isset() and unset() help us manage our variables within the scope of a web application: isset() We use the isset() function to determine whether the argument variable exists. The isset() function returns true if the variable exists and false otherwise. Its syntax follows: isset(var); unset() We use the unset() function to destry the argument variable. Its syntax follows: unset(var);
Next: PHP HTTP Functions
|