Php Interview Question and Answers
9. |
How would you acquire a Unix timestamp representing the current date and time? |
|
The time() function returns the current date in timestamp format. |
|
|
10. |
How would you end a session and erase all traces of it for future visits? |
|
The session_destroy() function removes all traces of a session for future requests. |
|
|
11. |
Can you include a function call within a string, as you can with a variable? |
|
No. You must call functions outside quotation marks. |
|
|
12. |
Which $_SERVER array element could you use to determine the IP address of a user? |
|
The $_SERVER['REMOTE_ADDR'] element should store the user’s IP address. |
|
|