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.
 
Your Name Your Email-ID
Your Answer
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.
 
Your Name Your Email-ID
Your Answer
11. Can you include a function call within a string, as you can with a variable?
  No. You must call functions outside quotation marks.
 
Your Name Your Email-ID
Your Answer
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.
 
Your Name Your Email-ID
Your Answer
12345678 Page 3 of 8