🧪 PHP MCQ Quiz Hub

PHP Mcq Set 3

Choose a topic to test your knowledge and improve your PHP skills

1. Which superglobal stores a variety of information pertinent to a file uploaded to the server via a PHP script?




2. How many items are available in the $_FILES array?




3. Which function is used to determine whether a file was uploaded?




4. What is the full form of DNS?




5. Which one of the following function checks for the existence of DNS records?




6. Which one of the following function is used to return an array consisting of various DNS resource records pertinent to a specific domain?




7. Which one of the following function is used to retrieve the MX records for the domain specified by hostname?




8. What is the default port number of HTTPs?




9. Which one of the following function returns the port number of a specified service?




10. Which one of the following statements can be used to establish port 80 connection with www.nachi.com?




11. Which one of the following function is used to send an email using PHP script?




12. How many configuration directives pertinent to PHPs mail function are available?




13. Which of the following statements is used to add an attachment to the mail?




14. Which one of the following is the very first task executed by a session enabled page?




15. How many ways can a session data be stored?




16. Which directive determines how the session information will be stored?




17. Which one of the following is the default PHP session name?




18. If session.use_cookie is set to 0, this results in use of _____________




19. If the directive session.cookie_lifetime is set to 3600, the cookie will live until ____________




20. Neglecting to set which of the following cookie will result in the cookies domain being set to the host name of the server which generated it.




21. What is the default number of seconds that cached session pages are made available before the new pages are created?




22. What is the default time(in seconds) for which session data is considered valid?




23. Which one of the following function is used to start a session?




24. Which function is used to erase all session variables stored in the current session?




25. What will the function session_id() return is no parameter is passed?




26. Which one of the following statements should you use to set the session username to Nachi?




27. An attacker somehow obtains an unsuspecting users SID and then using it to impersonate the user in order to gain potentially sensitive information. This attack is known as __________




28. Which parameter determines whether the old session file will also be deleted when the session ID is regenerated?




29. Which function effectively deletes all sessions that have expired?




30. Which function is used to transform PHPs session-handler behavior into that defined by your custom handler?




31. The session_start() function must appear _________




32. What is the return type of session_set_save_handler() function?




33. Which one of the following statements should be used to disable just the fopen(), and file() functions?




34. Which one of the following statements should be used to disable the use of two classes administrator and janitor?




35. What is the default value of max_execution_time directive? This directive specifies how many seconds a script can execute before being terminated.




36. The memory_limit is only applicable if ________ is enabled when you configure PHP.




37. Suppose all web material is located within the directory /home/www. To prevent users from viewing and manipulating files such as /etc/password, which one of the following statements should you use?




38. Which Apache directive outputs Apaches server version, server name, port and compile-in modules?




39. Which directive determines which degree of server details is provided if the ServerSignature directive is enabled?




40. Which directive should we disable to obscure the fact that PHP is being used on our server?




41. Say I want to change the extension of a PHP file, which of the following statements should I edit to change from .php to .html in the httpd.conf file?




42. AddType application/x-httpd-asp .asp




43. What will be the output if we replace the line $num = preg_grep(“/[0-5]/”, $number); with $num = preg_grep(“/[0-5]/”, $number, PREG_GREP_INVERT);?




44. Which one of the following functions are used to search a string?




45. Which one of the following preg PHP function is used to do a find and replace on a string or an array?




46. Which one of the following preg PHP functions is used to take a string, and put it in an array?




47. Which one of the following is not a preg PHP function?




48. Parameter flags was added in which version of PHP?




49. Which one of the following databases has PHP supported almost since the beginning?




50. The updated MySQL extension released with PHP 5 is typically referred to as _____