wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

KNOWLEDGE GAME

Total questions: 11

Worksheet time: 8mins

Name
Class
Date
1.

What does PHP stand for?

a)

Personal Home Page

b)

Hypertext Preprocessor

c)

Pretext Hypertext Processor

d)

Preprocessor Home Page

2.

PHP files have a default file extension of_______

a)

.html

b)

.xml

c)

.php

d)

.ph

3.

Which of the following must be installed on your computer so as to run PHP script?

a)

Adobe Dreamweaver

b)

XAMPP

c)

Apache and PHP

d)

IIS

4.

How should we add a single line comment in our PHP code?

a)

/?

b)

//

c)

#

d)

/* */

5.

<?php $num = 1; $num1 = 2;

print $num . "+". $num1; ?>

a)

3

b)

1+2

c)

1.+.2

d)

Error

6.

What will be the output of the following PHP code?

<?php $num = "1"; $num1 = "2";

print $num+$num1; ?>

a)

3

b)

1+2

c)

Error

d)

12

7.

Which of the following PHP statements will output Hello World on the screen?

a)

echo ("Hello World");

b)

print ("Hello World");

c)

printf ("Hello World");

d)

sprintf ("Hello World");

8.

Which of the following PHP statements will output Hello World on the screen?

a)

echo ("Hello World");

b)

print ("Hello World");

c)

printf ("Hello World");

d)

sprintf ("Hello World");

9.

What will be the output of the following PHP code?

<?php $color = "maroon"; $var = $color[2];

echo "$var"; ?>

a)

a

b)

error

c)

$var

d)

r

10.

What will be the output of the following PHP code?

<?php $a = "clue";

$a .= "get";

echo "$a"; ?>

a)

get

b)

clue

c)

clue.get

d)

clueget

11.

Which of the conditional statements is/are supported by PHP?

a)

if statements

b)

if-else statements

c)

if-elseif statements

d)

Switch case