A ___________ typically connects personal devices within an individual's immediate vicinity, such as connecting a smartphone to a laptop via Bluetooth.

  • WAN
  • LAN
  • PAN
  • MAN
PAN (Personal Area Network) is a network for personal devices and is typically used for connections within an individual's immediate vicinity, often within the range of a single person. Examples include connecting a smartphone to a laptop via Bluetooth or connecting a smartwatch to a phone.

You are developing a PHP script where you need to ensure that a particular value, say the company name, remains unchanged throughout the script. Which of the following would be the best approach?

  • Define a constant
  • Use a global variable
  • Pass the value as a function parameter
  • Store the value in a session variable
Defining a constant in PHP ensures that the value remains unchanged throughout the script, providing a read-only variable. This is suitable for constant values like company names.

Which of the following SQL statements is used to start a transaction in a relational database?

  • BEGIN TRANSACTION
  • INITIATE TRANSACTION
  • START TRANSACTION
  • CREATE TRANSACTION
The correct SQL statement to begin a transaction in a relational database is "BEGIN TRANSACTION." Starting a transaction is essential for ensuring data consistency.

Imagine you're building a feedback form where users can submit comments. To prevent potential script injections, which PHP function would you use to process the comment text before displaying it back to other users or saving it to a database?

  • htmlentities()
  • urlencode()
  • strip_tags()
  • base64_encode()
The htmlentities() function is used to convert potentially harmful characters in user input to their HTML entities, preventing script injections. It's a security measure to sanitize user-generated content.

When debugging, it's useful to have a ________ environment that mirrors the production environment.

  • Test
  • Development
  • Staging
  • Production
A staging environment closely mimics the production environment, allowing for more realistic debugging and testing before deploying.

To ensure security, before saving an uploaded file, which of the following PHP functions can be used to check if the uploaded file is an expected type?

  • file_exists()
  • is_uploaded_file()
  • file_get_contents()
  • mime_content_type()
The correct function to check the uploaded file's type is mime_content_type(). This function retrieves the MIME type of a file, which is crucial for security, as it helps prevent malicious file uploads.

You are reviewing a colleague's PHP code and notice they are using raw SQL statements with user input directly in the query. What potential issue does this introduce?

  • SQL Injection vulnerabilities
  • Improved query performance
  • Better code readability
  • Enhanced database compatibility
Using raw SQL statements with user input directly in the query introduces SQL Injection vulnerabilities, a major security risk.

Which network type spans a large geographic area, often connecting multiple cities or even countries?

  • LAN
  • MAN
  • PAN
  • WAN
WAN (Wide Area Network) is a network that covers a broad area, connecting multiple LANs that might be on opposite sides of the world. It can span cities, states, or even countries. The internet is the largest example of a WAN.

The PHP function that compares two arrays and returns the differences is called ________.

  • array_diff()
  • array_merge()
  • array_intersect()
  • array_unique()
The array_diff() function in PHP compares two arrays and returns the differences between them, providing a useful tool for array comparison and manipulation.

A class that cannot be instantiated and is intended to be inherited by other classes is known as a ________ class.

  • 'abstract'
  • 'final'
  • 'static'
  • 'interface'
An 'abstract' class in PHP is meant to be inherited by other classes. It can't be instantiated on its own and often contains abstract methods to be implemented by child classes.