MCQ Bank
What is the purpose of the $_GET array in PHP?
- A) To access session data
- B) To store global variables
- C) To retrieve data from a form submission using the GET method
- D) To interact with the server file system
What does AJAX stand for in web development?
- A) Advanced JavaScript and XML
- B) Asynchronous jQuery and XHTML
- C) Asynchronous JavaScript and XML
- D) Active JavaScript and XML
Which conditional statement is used to execute a block of code if a certain condition is true?
- A) else
- B) if
- C) switch
- D) for
Which loop in PHP will always execute the loop body at least once?
- A) while loop
- B) do-while loop
- C) for loop
- D) foreach loop
How can you access an object's property in PHP?
- A) By using the dot (.) operator
- B) By using the equals (=) operator
- C) By using the double colon (::) operator
- D) By using the arrow (->) operator
Which operator is used for string concatenation in PHP?
- A) *
- B) /
- C) +
- D) .
What is the file extension for a PHP file?
- A) .html
- B) .php
- C) .js
- D) .css
Which visibility keyword is used when a property should only be accessible within its own class?
- A) Protected
- B) Private
- C) Static
- D) Public
Which keyword is used to define a class in PHP?
- A) new
- B) object
- C) class
- D) define
What does the jQuery "fadeOut" method do?
- A) It applies a CSS animation to an HTML element.
- B) It adds a fade-in effect to an HTML element.
- C) It removes an HTML element from the DOM.
- D) It makes an HTML element invisible with a fading effect.
How can you access a static property of a class in PHP?
- A) By using the parent keyword
- B) By using the object of the class
- C) By using the self-keyword
- D) By using the static keyword
When should you use the GET method instead of POST in PHP?
- A) When performing database operations.
- B) When sending sensitive data, such as passwords.
- C) When the data being sent should not be visible in the URL.
- D) When the data being sent is too large to fit in the URL.
What is a server-side technology used for web development?
- A) HTML
- B) CSS
- C) PHP
- D) JavaScript
What is the role of PHP in server-side development?
- A) It interacts with databases and generates dynamic web content.
- B) It handles client-side events.
- C) It manages the server's operating system.
- D) It handles animations and DOM manipulation.
Which one of the following super global arrays is used to retrieve data sent via the HTTP GET method in PHP?
- A) $_REQUEST
- B) $_SERVER
- C) $_GET
- D) $_POST
WHERE keyword in SQL is used to
- A) Specify the IP address of database server
- B) Indicated that only records that match the given criteria expression should be returned
- C) Specify the location where the Database is stored on the server
- D) Indicate the table from which the data should be fetched
What is the purpose of PHP filters?
- A) To handle errors in PHP code
- B) To apply styling to HTML elements
- C) To filter and sanitize user input data
- D) To execute complex database queries
What are regular expressions in PHP?
- A) Predefined functions used to handle errors in PHP
- B) Special characters used to concatenate strings
- C) Patterns used to search, match, and manipulate strings
- D) Built-in PHP functions used for database operations
In SQL if we want to fetch data from multiple tables in a database we use the concept of
- A) Join
- B) Collection
- C) Aggregation
- D) Arrays
Following is the name of a PHP MySQL API
- A) mysqli
- B) phpExtend
- C) JavaScript
- D) phpMyAdmin