PHP MCQs with answers Page - 124

Here, you will find a collection of MCQ questions on PHP. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 828.03K Points
Coach

Q. Which PHP superglobal contains uploaded file data?

  • (A) $_POST
  • (B) $_FILES
  • (C) $_REQUEST
  • (D) $_UPLOAD

A

Admin • 828.03K Points
Coach

Q. Which PHP function moves an uploaded file securely?

  • (A) copy()
  • (B) rename()
  • (C) move_uploaded_file()
  • (D) upload_file()

A

Admin • 828.03K Points
Coach

Q. Which PHP function generates a random integer securely?

  • (A) rand()
  • (B) mt_rand()
  • (C) random_int()
  • (D) shuffle()

A

Admin • 828.03K Points
Coach

Q. Which PHP function generates a random string of bytes?

  • (A) rand_bytes()
  • (B) random_bytes()
  • (C) bytes_random()
  • (D) secure_bytes()

A

Admin • 828.03K Points
Coach

Q. Which PHP function validates an email address?

  • (A) is_email()
  • (B) filter_var()
  • (C) validate_email()
  • (D) email_check()

A

Admin • 828.03K Points
Coach

Q. Which PHP filter removes unsafe characters from a string?

  • (A) FILTER_SANITIZE_STRING
  • (B) FILTER_VALIDATE_STRING
  • (C) FILTER_CLEAN
  • (D) FILTER_STRING

A

Admin • 828.03K Points
Coach

Q. Which PHP feature helps reuse code across classes?

  • (A) Interfaces
  • (B) Abstract classes
  • (C) Traits
  • (D) Namespaces

A

Admin • 828.03K Points
Coach

Q. Which keyword prevents a class from being inherited?

  • (A) static
  • (B) private
  • (C) sealed
  • (D) final

A

Admin • 828.03K Points
Coach

Q. Which keyword prevents a method from being overridden?

  • (A) static
  • (B) final
  • (C) private
  • (D) protected

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ