PHP Interview Question and Answers
6. | What is a Session? | ||||||
---|---|---|---|---|---|---|---|
A session is a logical object created by the PHP engine to allow you to preserve data across subsequent HTTP requests. Sessions are commonly used to store temporary data to allow multiple PHP pages to offer a complete functional transaction for the same visitor. | |||||||
|
7. | How can we register the variables into a session? |
---|---|
<?php session_register($ur_session_var); ?> |
|
8. | How do you destroy a particular or all Sessions? |
---|---|
<?php session_start(); // store session data $_SESSION['views']=1; unset($_SESSION['views']); // If you wish to delete some session data, you can use the unset() session_destroy(); // You can also completely destroy the session by calling the session_destroy() function. session_destroy() will reset your session and you will lose all your stored session data. ?> |
|
9. | How many ways we can pass the variable through the navigation between the pages? |
---|---|
|
|
10. | What are the different functions in sorting an array? |
---|---|
|
|