wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

FINAL REVISION GUIDE

Total questions: 120

Worksheet time: 3600secs

Name
Class
Date
1.

What is PHP?

a)

Personal Home Page

b)

Hyper Text Preprocessor

2.

PHP Scripts are executed on

a)

Client

b)

Server

3.

Current Version of PHP is

a)

7

b)

8

4.

PHP is used by

a)

FaceBook

b)

Apple

5.

App Built using in PHP

a)

Instagram

b)

Facebook

6.

PHP is _______________scripting language

a)

Server

b)

Client

7.

Syntax used to display a message "Helloworld"

a)

display "Hello World"

b)

echo "Hello World

8.

A php Script starts with

a)

?>

b)

<?php

9.

A php script ends with

a)

<?php

b)

?>

10.

Comments in php are

a)

executable

b)

non-executable

11.

Symbol for Using Comments

a)

#

b)

/

12.

Comments can be used to:

a)

Let others understand your code

b)

Let others execute your code

13.

Comments can be used to:

a)

Make the program executable

b)

Remind yourself of what you did

14.

Symbol for multi line comment

a)

/* - */

b)

#

15.

Statements in php must end with

a)

;

b)

:

16.

Create a variable named txt and assign the value "Hello".

a)

txt = "Hello";

b)

$txt="Hello";

17.

Symbol used to create a variable is

a)

$

b)

#

18.

_______________ as containers for storing data.

a)

variables

b)

statements

19.

A variable starts with the $ sign, followed by the name of the variable

a)

True

b)

False

20.

A variable name must start with a letter or the underscore character

a)

True

b)

False

21.

A variable name can start with a number

a)

True

b)

False

22.

False

a)

True

b)

False

23.

Variable names are not case-sensitive

a)

True

b)

False

24.

What is the output of the code

<?php

$nvtc = "Bahrain";

echo "I love $nvtc!";

?>

a)

I love Bahrain

b)

I love nvtc

25.

Data Type tells about______

a)

Variable Name

b)

Type of Data

26.

A __________ is a sequence of characters

a)

character

b)

string

27.

A string in enclosed between

a)

single quote and double quotes

b)

single quotes only

28.

An ____________data type is a non-decimal number

a)

integer

b)

float

29.

An integer must have at least one digit

a)

True

b)

False

30.

An integer can have a decimal point

a)

True

b)

False

31.

An integer can be either positive or negative

a)

True

b)

False

32.

Example of integer is

a)

$x = 5985;

b)

$x = 59.85;

33.

A _________________ is a number with a decimal point

a)

float

b)

integer

34.

Example of float

a)

$x = 10365;

b)

$x = 10.365;

35.

.A______________________represents two possible states: TRUE or FALSE.

a)

boolean

b)

string

36.

PHP Files have extension

a)

.html

b)

.php

37.

Symbol for Comments

a)

*

b)

//

38.

__________________ are often used in conditional testing

a)

booleans

b)

strings

39.

The PHP _____________function returns the length of a string

a)

strlen()

b)

str()

40.

The PHP _____________________ function counts the number of words in a string

a)

strlen()

b)

str_word_count()

41.

The PHP __________ function reverses a string.

a)

strlen()

b)

strrev()

42.

The PHP _____________function searches for a specific text within a string

a)

strsearch()

b)

strpos()

43.

The PHP __________________function replaces some characters with some other characters in a string.

a)

strpos()

b)

str_replace()

44.

Get the length of the string "Hello World!".

echo ___________("Hello World!");

a)

strlen

b)

strcount

45.

Reverse the string "Hello World!".

echo ___________("Hello World!");

a)

strrev

b)

strlen

46.

.____________ are used to perform operations on variables and values.

a)

Operators

b)

Operands

47.

Sum of $x and $y

a)

$x - $y

b)

$x + $y

48.

Difference of $x and $y

a)

$x + $y

b)

$x - $y

49.

Product of $x and $y

a)

$x * $y

b)

$x ** $y

50.

Quotient of $x and $y

a)

$x / $y

b)

$x % $y

51.

Remainder of $x divided by $y

a)

$x % $y

b)

$x / $y

52.

Value of 9 % 2

a)

1

b)

4.5

53.

Value of 9 / 2

a)

4.5

b)

1

54.

x == y if y=5 then x is

a)

0

b)

5

55.

x +=5, if x=1 then output of expression is

a)

5

b)

6

56.

x -=5, if x=1 then output of expression is

a)

-4

b)

4

57.

x *=5, if x=2 then output of expression is

a)

2.5

b)

10

58.

x /=2, if x=5 then output of expression is

a)

10

b)

2.5

59.

x %=2, if x=5 then output of expression is

a)

2.5

b)

1

60.

Multiply 10 with 5, and output the result.

a)

echo 10 * 5;

b)

echo 10 / 5;

61.

Divide 10 by 2, and output the result.

a)

echo 10 / 2

b)

echo 10 * 2

62.

Symbol for checking Equality is

a)

=

b)

==

63.

Symbol for checking Identical

a)

===

b)

==

64.

Symbol for checking Not Equal

a)

$x != $y

b)

$x == $y

65.

Symbol for checking not equal

a)

$x == $y

b)

$x <> $y

66.

Returns true if $x is greater than $y

a)

$x > $y

b)

$x < $y

67.

Returns true if $x is less than $y

a)

$x > $y

b)

$x < $y

68.

Returns true if $x is greater than or equal to $y

a)

$x >= $y

b)

$x <= $y

69.

Returns true if $x is less than or equal to $y

a)

$x <= $y

b)

$x >= $y

70.

___________ statements are used to perform different actions based on different conditions.

a)

conditional

b)

looping

71.

Identify the conditional statement

a)

while

b)

if

72.

Identify the conditional statement

a)

do......while

b)

if .... else

73.

Identify the conditional statement

a)

switch

b)

for

74.

The if statement executes some code if one condition is _______

a)

True

b)

False

75.

.$x=20

$y=10

if ( $x > $y)

{ echo "x is big";

}

else

{ echo "y is big";

}

a)

y is big

b)

x is big

76.

.$x=20

$y=40

if ( $x > $y)

{

echo "x is big";

}

else

{

echo "y is big";

}

a)

x is big

b)

y is big

77.

if.......else statement can be used to execute

a)

True Section and False Section

b)

Only True Section

78.

if ....statement can be used to execute

a)

True Section and False Section

b)

True Section only

79.

.$x=5;

$y=10;

if( $x >= $y)

{ echo "I won the game";

}

else

{ echo "I lost the game";

}

a)

I won the game

b)

I lost the game

80.

The ____________statement is used to perform different actions based on different conditions.

a)

switch

b)

if

81.

what is the output of code

<?php

$favcolor = "yellow";

switch ($favcolor) {

case "red":

echo "Your favorite color is red!";

break;

case "blue":

echo "Your favorite color is blue!";

break;

case "green":

echo "Your favorite color is green!";

break;

default:

echo "Your favorite color is neither red, blue, nor green!";

}

?>

a)

Your favorite color is Yellow

b)

Your favorite color is neither red,blue, not green!

82.

_______are used to execute the same block of code again and again, as long as a certain condition is true.

a)

switch

b)

loop

83.

.________ loops through a block of code as long as the specified condition is true

a)

dowhile

b)

while

84.

_________ loops through a block of code once, and then repeats the loop as long as the specified condition is true

a)

do while

b)

while

85.

_______loops through a block of code a specified number of times

a)

for

b)

foreach

86.

___________loops through a block of code for each element in an array

a)

for

b)

foreach

87.

which loop checks the condition before execution

a)

do while

b)

while

88.

which loop checks the condition after

a)

do while

b)

while

89.

which loop does not have initialization, condition checking and increment and decrement

a)

for

b)

for each

90.

The first argument in for loop is

a)

initialization

b)

condition checking

91.

Second argument in for loop is

a)

Initialization

b)

Condition Checking

92.

Third argument in for loop is

a)

initialization

b)

increment and decrement

93.

An ________ stores multiple values in one single variable:

a)

Array

b)

Variable

94.

Starting index of an array begins with

a)

0

b)

1

95.

<?php

$cars = array("Volvo", "BMW", "Toyota");

?>

a)

cars[1]

b)

cars[0]

96.

The _________function is used to return the length (the number of elements) of an array:

a)

count

b)

length

97.

$fruits = array("Apple", "Banana", "Orange");

a)

echo ($fruits);

b)

echo count($fruits);

98.

A __________array is an array containing one or more arrays.

a)

single dimensional

b)

multi dimensioal

99.

what is the output statement for getting "Land Rover"

$cars = array (

array("Volvo",22,18),

array("BMW",15,13),

array("Saab",5,2),

array("Land Rover",17,15)

a)

echo $cars[3][0];

b)

echo $cars[3][1];

100.

What is the use of Form ?

a)

used to submit data

b)

used to read data

c)

used to collect data

d)

used to send data

101.

A form is attribute used to send data to server page

a)

Submit

b)

Method

c)

Form

d)

Action

102.

A method used to send data to server which is visible

a)

Post

b)

Get

c)

Get and POST

d)

Above ALL

103.

A method which send the data whose limit is 2000 characters

a)

Get

b)

Post

c)

Get and POST

d)

Above ALL

104.

A method which is used by most developers

a)

Get

b)

Post

c)

Get and POST

d)

Above ALL

105.

A method which is used for sending data by hiding is

a)

Get and POST

b)

Above ALL

c)

Get

d)

Post

106.

The Action attribute of the Tag FORM is called by

a)

Button

b)

Reset

c)

All the above

d)

Submit

107.

The default value of the TextField is changed by using the attribute

a)

Value

b)

Name

c)

ID

d)

Text

108.

The Style rules written inside the tag is called as

a)

External

b)

inline

c)

embedded

109.

The Style rules written inside the tag <style> tag is called as

a)

embedded

b)

inline

c)

external

110.

The Style rules written inside the (styles.css) file is called as

a)

inline

b)

embedded

c)

external

111.

Process of checking the data is called

a)

Verification

b)

Validation

c)

Crosschecking

d)

Finalizing

112.

A php page calls itself by using the attribute

a)

$_SERVER[PHP_SELF]

b)

$_GET

c)

$_POST

d)

$REQUEST_METHOD

113.

Regular Expressions are used for

a)

Improves Code

b)

Writing Expressions

c)

Validation

d)

Used for calculations

114.

Code reusability is achieved using the concept of

a)

Expressions

b)

Variables

c)

Arrays

d)

Functions

115.

The Syntax used to send an email is

a)

mailto(mail id, subject )

b)

mail ( mail id, subject, message)

c)

sendmail(mail id, subject ,message)

d)

mail ( mail id, message)

116.

Form Elements used to check I agree to terms and conditions feature is

a)

Radio

b)

Submit

c)

Check box

d)

Reset

117.

Form Elements used to for entering the password is

a)

Radio

b)

TextField

c)

Checkbox

d)

Password

118.

What is the abbreviation of XSS

a)

Cross Side Scripting

b)

Cross site scripting

c)

Extreme site scripting

d)

Extreme Side Scripting

119.

What is the Full form of CSS

a)

Cascading Style Sheets

b)

Cascading Simple Sheets

c)

Cascading Server Sheets

d)

Cascading Server Side

120.

Functions used for Regular Expressions

a)

preg_verify

b)

preg_validate

c)

preg_check

d)

preg_match