Web Application Development MCQs with Answers
Practice important Web Application Development MCQs with answers and explanations.
Multiple Choice Questions
Q101: What is the primary purpose of PHP filters?
- A: Validating and sanitizing data
- B: Encrypting data
- C: Compressing data
- D: Formatting data
View Answer
A
Q102: Fill in the blank: The filter_var() function is used to _______ and sanitize data.
- A: validate
- B: encode
- C: decrypt
- D: format
View Answer
A
Q103: Which PHP filter is used to sanitize a string by removing all HTML tags?
- A: FILTER_SANITIZE_STRING
- B: FILTER_SANITIZE_EMAIL
- C: FILTER_SANITIZE_URL
- D: FILTER_SANITIZE_INT
View Answer
A
Q104: Fill in the blank: To check if a variable $email contains a valid email address, you use _______ filter.
- A: FILTER_VALIDATE_EMAIL
- B: FILTER_SANITIZE_EMAIL
- C: FILTER_VALIDATE_URL
- D: FILTER_VALIDATE_INT
View Answer
A
Q105: Fill in the blank: To remove all illegal characters from a URL, use the filter_var() function with _______ filter.
- A: FILTER_SANITIZE_URL
- B: FILTER_SANITIZE_STRING
- C: FILTER_VALIDATE_EMAIL
- D: FILTER_VALIDATE_INT
View Answer
A
Q106: Which function is used to check if an IP address is valid?
- A: filter_var() with FILTER_VALIDATE_IP
- B: filter_ip()
- C: validate_ip()
- D: check_ip()
View Answer
A
Q107: Fill in the blank: The filter_var() function can sanitize an email address using _______ filter.
- A: FILTER_SANITIZE_EMAIL
- B: FILTER_SANITIZE_URL
- C: FILTER_SANITIZE_STRING
- D: FILTER_VALIDATE_INT
View Answer
A
Q108: What is the result if $url contains illegal characters and is processed with FILTER_SANITIZE_URL?
- A: The illegal characters are removed
- B: The URL becomes invalid
- C: The URL remains unchanged
- D: An error is thrown
View Answer
A
Q109: Fill in the blank: To ensure that $ip is a valid IP address, you use the filter_var() function with _______ filter.
- A: FILTER_VALIDATE_IP
- B: FILTER_VALIDATE_URL
- C: FILTER_SANITIZE_IP
- D: FILTER_SANITIZE_URL
View Answer
A
Q110: What is a database?
- A: A collection of data
- B: A type of software application
- C: A programming language
- D: A hardware component
View Answer
A