🧪 PHP MCQ Quiz Hub

PHP Mcq Set 2

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

1. How many functions does PHP offer for searching and modifying strings using Perl-compatible regular expressions.




2. Which one of the following functions will convert a string to all uppercase?




3. Which one of the following functions can be used to concatenate array elements to form a single delimited string?




4. Which one of the following functions finds the last occurrence of a string, returning its numerical position?




5. The filesize() function returns the file size in ___________




6. Which one of the following PHP function is used to determine a file’s last access time?




7. Which one of the following function is capable of reading a file into an array?




8. Which one of the following function is capable of reading a file into a string variable?




9. Which one of the following function is capable of reading a specific number of characters from a file?




10. Which one of the following function operates similarly to fgets(), except that it also strips any HTML and PHP tags form the input?




11. Which one of the following function outputs the contents of a string variable to the specified resource?




12. Which function sets the file filename last-modified and last-accessed times?




13. Which function is useful when you want to output the executed command result?




14. Which one of the following function reads a directory into an Array?




15. The date() function returns ___ representation of the current date and/or time.




16. Which one of the following format parameter can be used to identify timezone?




17. If the format is F then which one of the following will be returned?




18. Which one of the following function is useful for producing a timestamp based on a given date and time?




19. Which function displays the web page’s most recent modification date?




20. Suppose you want to calculate the date 45 days from the present date which one of the following statement will you use?




21. To create an object and set the date to JUNE 22, 2013, which one of the following statement should be executed?




22. How many methods does the DateTime class have?




23. How many constants does the DateTime class have?




24. Which method is simply an object-oriented version of date()?




25. Which of the following is the right way to use the DateTime class?




26. Which of the following statements can be used to set the time zone in individual scripts?




27. Which of the following statements can be used to add two months to the existing date?




28. Which method enables you to calculate whether daylight saving time is in force at a specific date and time?




29. Which two predefined variables are used to retrieve information from forms?




30. The attack which involves the insertion of malicious code into a page frequented by other users is known as _____________




31. When you use the $_GET variable to collect data, the data is visible to ______




32. When you use the $_POST variable to collect data, the data is visible to _____




33. Which variable is used to collect form data sent with both the GET and POST methods?




34. Which one of the following should not be used while sending passwords or other sensitive information?




35. Which function is used to remove all HTML tags from a string passed to a form?




36. To validate an email address, which flag is to be passed to the function filter_var()?




37. How many validation filters like FILTER_VALIDATE_EMAIL are currently available?




38. How many predefined variables does PHP use to authenticate a user?




39. Which function is used to verify whether a variable contains a value?




40. In which authentication method does changing the username or password can be done only by entering the code and making the manual adjustment.




41. The authenticationFile.txt, the file which stores username and password should be stored ___ the server document root.




42. Which function is used to split a string into a series of substrings, with each string boundary is determined by a specific separator?




43. Which is the most powerful authentication method among the four?




44. Which directive determines whether PHP scripts on the server can accept file uploads?




45. Which of the following directive determines the maximum amount of time that a PHP script will spend attempting to parse input before registering a fatal error?




46. What is the default value of max_input_time directive?




47. Since which version of PHP was the directive max_file_limit available.




48. What is the default value of the directive max_file_limit?




49. Which directive sets a maximum allowable amount of memory in megabytes that a script can allow




50. If you want to temporarily store uploaded files in the /tmp/phpuploads/ directory, which one of the following statement will you use?