Back To Lesson

Quiz: PHP Fundamentals

Quiz Instructions:

  • Each question is followed by multiple-choice answers (A, B, C, D, and sometimes E).
  • Carefully read each question and all answer options before selecting the best answer.
  • Choose the option that most accurately aligns with the key concepts or information provided.

Question 1: What is PHP primarily used for in web development?

Question 2: Which function displays information about your PHP installation?

Question 3: How do you declare a variable in PHP?

Question 4: Which PHP data type is used to store multiple values in a single variable?

Question 5: What is the purpose of the $_POST superglobal in PHP?

Question 6: Which loop would you use to iterate over an array in PHP?

Question 7: What is the purpose of the session_start() function in PHP?

Question 8: Which function is used to sanitize input by converting special characters to HTML entities?

Question 9: What does the setcookie() function do in PHP?

Question 10: How can you check for errors in your PHP code?

Question 11: Which PHP function validates and filters input data?

Question 12: Which PHP function prevents SQL injection attacks?