SIA 402 — Reviewer for Midterm
- What does PHP stand for?
PHP: Hypertext Preprocessor - Which of the following tags is used to embed PHP code in an HTML document?
<?php ?> - What is the correct way to start a PHP script block?
<?php - Which of the following is used to display output in PHP?
echo - What is the PHP function to check the length of a string?
strlen() - In PHP, how do you define a constant?
define() - What is the default method for sending data to the server in an HTML form using PHP?
GET - Which of the following is not a valid PHP data type?
char - How can you comment out a single line in PHP?
// Comment - What is the operator used for concatenating two strings in PHP?
. – Dot Symbol - What is the function used to establish a database connection in PHP?
mysqli_connect() - Which superglobal variable in PHP is used to access form data sent with the GET method? -
$_GET - How can you prevent SQL injection in PHP?
Use prepared statements - Which PHP function is used to check if a file exists?
file_exists() - What is the purpose of the PHP function
include()?
To include a file in the current script - Which of the following functions is used to remove leading and trailing white spaces from a string in PHP?
trim() - What is the purpose of the PHP
session_start() function?
To start a new session or resume the existing one - Which PHP function is used to redirect a user to a different URL?
header() - What is the purpose of the
empty() function in PHP?
To check if a variable is empty or not set - Which of the following is not a valid way to access an array element in PHP?
$array(1) - What is the correct way to start a PHP session?
session_start() - How do you define a function in PHP?
functionmyFunction() {} - Which of the following is a valid way to comment out multiple lines in PHP?
/* This is a comment */ - What is the purpose of the
header() function in PHP?
To set HTTP headers for a response - How do you declare an array in PHP?
$array = array(); - What is the output of the following code?
$x = 5;
$y = 10;
echo $x + $y;
15 - How can you include an external PHP file in your script?
require() - What is the purpose of the
var_dump() function in PHP?
To output the value of a variable and its type - Which function is used to remove a cookie in PHP?
setcookie() with an expired time - What does the
$_SESSION superglobal variable store in PHP?
Session data that can be shared across multiple pages - What is the purpose of the
die() function in PHP?
Terminate a script and display an error message - In PHP, which operator is used for strict equality comparison (including data type)?
=== - What is the purpose of the
break statement in a PHP loop?
Terminate the loop and exit it - Which function is used to sort an array in descending order in PHP?
arsort() - What is the purpose of the
continue statement in a PHP loop?
Skip the current iteration and move to the next - What is the correct way to declare a global variable in PHP?
global $variable; - How can you retrieve the number of elements in an array in PHP?
count() - What does the
array_push() function do in PHP?
Adds one or more elements to the end of an array - Which of the following PHP superglobal variables is used to access session variables?
$_SESSION - What is the purpose of the
array_merge() function in PHP?
Create a new array by merging two or more arrays - In PHP, what does the function
json_encode() do?
Encodes a PHP array into a JSON string - Which PHP function is used to open a file for reading?
fopen() - What is the purpose of the
unlink() function in PHP?
Delete a file - How do you declare a variable as a constant in PHP with a case-insensitive name?
const() - Which PHP function is used to format a number with thousands separators?
number_format() - What is the purpose of the
file_get_contents() function in PHP?
Read the contents of a file into a string - In PHP, which operator is used for the modulus operation (finding the remainder of a
division)?
% - What is the correct way to check if a variable is an array in PHP?
is_array($variable) - Which function is used to send an email in PHP?
mail() - What is the purpose of the
mysqli_query() function in PHP?
Execute a SQL query on a MySQL database - What does HTML stand for?
Hyper Text Markup Language - Which HTML tag is used to create a hyperlink?
<a> - What is the primary purpose of CSS in web development?
To style the presentation of web content - Which programming language is commonly used for both front-end and back-end web
development?
JavaScript - What does the acronym "HTTP" stand for in the context of web development?
Hypertext Transfer Protocol - What is the purpose of the HTML tag?
To set metadata for a web page, such as character encoding and description - Which CSS property is used to change the text color of an element?
color - What is the purpose of the HTML element?
To create a container for input elements - Which file extension is commonly used for Cascading Style Sheets?
.css - Which web development tool is often used for version control and collaborative coding?
VCS (Version Control System) - What does "SEO" stand for in web development?
Search Engine Optimization - Which HTML element is used for creating an ordered list?
<ol> - What is the purpose of the JavaScript function
getElementById()?
To retrieve an element from the DOM by its ID - What is the primary purpose of the HTML element?
To create a navigation bar or header section - Which of the following is NOT a commonly used front-end framework/library for web
development?
Django - What is a responsive web design?
A design that adapts to different screen sizes and devices - What is the purpose of the HTML element?
To create a footer for a web page - Which web development language is often used to create dynamic web pages and interact
with databases?
PHP - What is a web developer's role in the context of front-end development?
Creating the user interface and user experience - What is the purpose of the CSS box model in web development?
To specify the layout and spacing of elements on a web page - Which HTML element is used to create an image in a web page?
<img> - In web development, what does "HTTP" stand for?
Hypertext Transfer Protocol - Which CSS property is used to set the size of text relative to its parent element?
font-size - What does the acronym "URL" stand for in web development?
Uniform Resource Locator - What is the purpose of the HTML element?
To define navigation links within a document - Which HTML element is used to create an unordered list?
<ul> - What is the purpose of the CSS property "margin"?
To control the space outside of an element - Which HTML element is used to create a paragraph of text?
<p> - What is the primary role of the HTML <table> element?
To structure and display tabular data - In web development, what is the purpose of the CSS property "padding"?
To control the space inside of an element
Made with Bullet