NEW
Font size
WorksheetsUnit 19 - First Quiz
Total questions: 20
Worksheet time: 10mins
PHP is a client-side programming language.
True
False
PHP can be embedded inside HTML code.
True
False
PHP scripts are executed on the server.
True
False
PHP variables must start with the $ symbol.
True
False
Multi-line comments in PHP use /* */.
True
False
Logical operators are used to perform mathematical calculations.
True
False
The while loop executes at least once, even if the condition is false
True
False
The break statement continues to the next iteration of a loop.
True
False
What does the str_replace() function do?
Reverses a string
Replaces part of a string
Splits a string
Finds string length
Which of the following is a numeric array?
$students = ["Ali", "Sara", "John"];
$students = ["name"=>"Ali", "age"=>20];
$students = [["Ali",20],["Sara",22]];
None of the above
Arrow functions are mainly used for:
Multi-line code blocks
Loops
Simple, one-line expressions
Database connections
Which function gives the number of seconds since January 1, 1970?
date()
time()
strtotime()
mktime()
Which numeric function rounds up to the nearest integer?
floor()
ceil()
round()
abs()
In associative arrays, values are stored with:
Keys
Indexes only
Strings only
None
strpos("Hello World", "o") returns:
2
4
5
6
Which is NOT a built-in numeric function in PHP?
pow()
sqrt()
strlen()
abs()
Which type of array can contain other arrays?
Indexed array
Associative array
Multidimensional array
String array
The continue keyword in PHP:
Ends the loop
Skips current iteration
Exits PHP code
Repeats the loop
Which version of PHP was popular in 2025?
7.48.2
8.2
5.6
9.0
Constants in PHP are defined using:
var()
define()
const()
set()
