NEW
Font size
WorksheetsPHP Quiz
Total questions: 35
Worksheet time: 6mins
Which of the following is correct about PHP?
PHP is a recursive acronym for "PHP: Hypertext Preprocessor".
PHP is a server side scripting language that is embedded in HTML.
It is used to manage dynamic content, databases, session tracking, even build entire e-commerce sites.
All of the above.
Which of the following is correct about PHP?
PHP performs system functions, i.e. from files on a system it can create, open, read, write, and close them.
PHP can handle forms, i.e. gather data from files, save data to a file, thru email you can send data, return data to the user.
You add, delete, modify elements within your database thru PHP.
All of the above.
Is PHP whitespace sensitive?
true
false
What is the output of this code?
The number is incorrect.
False
True
The number is 1
Which of the following is true about php variables?
All variables in PHP are denoted with a leading dollar sign ($).
The value of a variable is the value of its most recent assignment.
Variables are assigned with the = operator, with the variable on the left-hand side and the expression to be evaluated on the right.
All of the above.
Which of the following type of variables are whole numbers, without a decimal point, like 4195?
Integers
Double
Boolean
Strings
Which of the following type of variables are floating-point numbers, like 3.14159 or 49.1?
Integers
Double
Boolean
Strings
Which of the following type of variables have only two possible values either true or false?
Integers
Double
Boolean
Strings
What is the output of this code?
Yay! It`s Friday!
error
blank
Yay! It`s friday!
Which of the following type of variables are special type that only has one value: NULL?
Strings
Double
Boolean
NULL
Which of the following is not an arithmetic operator?
Addition(+)
Subtraction(-)
Multiplication(*)
Assign(=)
Using which of the following way can you embed PHP code in an HTML page?
<?php PHP code goes here ?>
<? PHP code goes here ?>
<script language="php"> PHP code goes here </script>
All of the above.
What will be the output of this line of codes?
Yay! It`s Friday
'Yay! It`s Friday'
error
blank
Is PHP case sensitive?
true
false
What will be the result of this line of code?
Your value for case 1 is 2
Your value for case 1 is 4
Your value for case 2 is 2
Your value for case 2 is 4
$var and $VAR are two different variables?
Yes
No
Which of the following is not correct rules for naming of the PHP variables?
$var
$Var
$4ab
$_abc
PHP variables need to be declared before adding a value to it.
True
False
Which of the following is correct about variable naming rules?
Variable names must begin with a letter or underscore character.
A variable name can consist of numbers, letters, underscores.
You cannot use characters like + , - , % , ( , ) . & , etc in a variable name.
All of the above.
Which of the following is not a comparison operators?
>
<
>=
+=
Which of the following is not a logical operators?
AND
OR
NOT
++
What is the output of this code?
1
0
null
error
Which of the following is correct operator for combining two strings?
Dot(.)
Addition(+)
Multiplication(*)
Which operator is used to find the modulus in PHP?
/
%
/
*
The output of this code would be?
The number is 1
The number is incorrect.
error
blank
What is correct output of echo 17%5
3
2
1
0
The output would be?
The number is 1
Incorrect data type.
The number is incorrect.
error
What is correct output of echo (10>5)
1
0
What is correct output of echo 2**3
2
3
6
8
FILL IN THE BLANKS
$message
message
text
return
What is the name of %= operator?
Divide and assign quotient
Divide and assign modulus
Subtraction and assign
Which of the following is not an assignment operators?
=
+=
%=
%
What is the missing operator on this code?
*
!=
%
&&
Which is not a floating point type?
1.234
1920202.4443
12.0
13
What is the displayed output on this code?
21
343
6561
49
