Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PHP Quiz 1

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

What type of language is PHP

a)

Client Side

b)

Server Side

c)

Browser Side

d)

Web Side

2.

PHP is executed on

a)

The Server

b)

The Browser

c)

The Website

d)

The Machine

3.

We store small snippets of information inside what?

a)

Functions

b)

Loops

c)

If Statements

d)

Variables

4.

We create re-usable code blocks by placing them inside?

a)

Variables

b)

Parameters

c)

Code Blocks

d)

Functions

5.

Sometimes we only want certain code to execute if a condition is true. How do we test for that?

a)

Loop

b)

If Statement

c)

Integer

d)

Variable

6.

What is a integer?

a)

It's a Whole Number

b)

It's a Decimal Number

c)

It's a True or False Declaration

d)

It's a String of Text

7.

What is a String?

a)

Text

b)

Number

c)

True

d)

Loop

8.

What is a Boolean

a)

It's Just Text

b)

It's a Number

c)

It's Just True

d)

It's True or False

9.

What if we want a block of code to execute several times?

a)

Use a Variable

b)

Use a Function

c)

Use a Loop

d)

Use a Leap

10.

$colours = array("black, blue, Red, Green") - How do I access "Red" ?

a)

$colours[0];

b)

$colours[2];

c)

$colours[1]

d)

$colours[3];

11.

How do I print out the values of the variable "name" ?

a)

$name;

b)

include $name;

c)

echo $name;

d)

echo $name

12.

function sayMyName(name) {} ; - How do I call tat function

a)

sayMyname();

b)

$sayMyName;

c)

$sayMyName();

d)

sayMyName("John")';

13.

What does i++ do ?

a)

Adds the text on to the end of i

b)

Adds i on to the end of something

c)

Adds i on to the existing value of i

d)

Adds 1 to the current value of iThis is a correct answer

14.

What type of variable is this: $isMale = false;

a)

Integer

b)

Boolean

c)

String

d)

char

15.

In an IF statement we can have 2 conditions tested. Which keyword allows this?

a)

Else

b)

if Else

c)

Else if

d)

OR

16.

$a = 4 ; $b = 6; $c = $a + $b; What is the value of variable "c" ?

a)

6

b)

8

c)

10

d)

None

17.

$a = "Ram"; $n = "Kumar"; $fullName = $f + $n; What is the value of $fulName

a)

RamKumar

b)

Ram Kumar

c)

Ram

d)

None

18.

$a = "Ram"; $n = "Kumar"; $fullName = $f . $n; What is the value of $fulName

a)

RamKumar

b)

Ram Kumar

c)

Kumar

d)

None

19.

function declarations can have (a)   assigned to them?

20.

Function calls can have____________ inside them.

a)

Parameters

b)

Arguments

c)

Variables

d)

Types