NEW
Font size
Worksheets5155495A203220504850
Total questions: 10
Worksheet time: 5mins
What is the difference between an 'operator' and an 'expression' in PHP?
Operators are values, while expressions are symbols like + or -.
Operators are symbols used to perform operations, while expressions are combinations of operators and values that produce a result.
Expressions are only used for math, while operators are only used for text.
There is no difference; the terms are interchangeable in PHP programming.
Which arithmetic operator is used specifically to determine the remainder of a division?
Division (/)
Multiplication (*)
Modulus (%)
Addition (+)
Which comparison operator is used to check if two values are 'not equal'?
==
!=
+=
&&
What is the purpose of the && and || logical operators?
To perform complex math calculations.
To join two strings together into one sentence.
To allow for complex conditional checks by combining multiple comparisons.
To change a variable from an integer to a float.
How does the elseif block function within a conditional structure?
It marks the very first condition to be checked.
It serves as the default action if every other check fails.
It provides alternative checks if the previous if condition was false.
It is used to stop the script from running any further.
Which block of code executes if all previous if and elseif conditions evaluate to false?
The if block.
The elseif block.
The else block.
The var_dump() block.
In what order does PHP evaluate conditions in an if...elseif...else structure?
It evaluates all blocks simultaneously.
It evaluates from bottom to top.
It evaluates sequentially from top to bottom until a condition is satisfied.
It evaluates them in random order depending on server speed.
Which command is used to retrieve data submitted from an HTML form using the POST method?
echo
var_dump()
$_POST["name"]
$_GET["name"]
What command can you use to display the data type and value of a comparison result for debugging?
echo
var_dump()
if
.
How can PHP be used to visually differentiate outcomes, such as highlighting a 'success' message in green?
By using the modulus operator.
By echoing CSS style attributes within HTML tags based on conditional logic.
By changing the file extension from .php to .css.
PHP cannot interact with visual styles.
