wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

W3 PHP Quiz

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.
What does PHP stand for?
a)
PHP: Hypertext Preprocessor
b)
Private Home Page
c)
Personal Hypertext Processor
2.
PHP server scripts are surrounded by delimiters, which?
a)
...
b)
c)
3.
How do you write "Hello World" in PHP
a)
echo "Hello World";
b)
Document.Write("Hello World");
c)
"Hello World";
4.
All variables in PHP start with which symbol?
a)
$
b)
&
c)
!
5.
What is the correct way to end a PHP statement?
a)
;
b)
New line
c)
6.
The PHP syntax is most similar to:
a)
Perl and C
b)
JavaScript
c)
VBScript
7.
How do you get information from a form that is submitted using the "get" method?
a)
Request.Form;
b)
$_GET[];
c)
Request.QueryString;
8.
When using the POST method, variables are displayed in the URL:
a)
True
b)
False
9.
In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings:
a)
False
b)
True
10.
What is the correct way to include the file "time.inc" ?
a)
b)
c)
d)
11.
What is the correct way to create a function in PHP?
a)
create myFunction()
b)
new_function myFunction()
c)
function myFunction()
12.
What is the correct way to open the file "time.txt" as readable?
a)
fopen("time.txt","r+");
b)
open("time.txt");
c)
fopen("time.txt","r");
13.
PHP allows you to send emails directly from a script
a)
False
b)
True
14.
Which superglobal variable holds information about headers, paths, and script locations?
a)
$_GET
b)
$_SERVER
c)
$_SESSION
15.
What is the correct way to add 1 to the $count variable?
a)
$count =+1
b)
$count++;
c)
++count
16.
What is a correct way to add a comment in PHP?
a)
...
b)
*\...\*
c)
/*...*/
17.
The die() and exit() functions do the exact same thing.
a)
False
b)
True
18.
Which one of these variables has an illegal name?
a)
$my_Var
b)
$my-Var
c)
$myVar
19.
How do you create an array in PHP?
a)
$cars = array("Volvo", "BMW", "Toyota");
b)
$cars = "Volvo", "BMW", "Toyota";
c)
$cars = array["Volvo", "BMW", "Toyota"];
20.
Which operator is used to check if two values are equal and of same data type?
a)
=
b)
!=
c)
===