wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Weekly Test 4

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.

Which tag is used for php

a)

<?php

?>

b)

<style>

c)

<php ?>

d)

<php

/php>

2.

In php the keyword to be used before function name is

a)

Function

b)

Static

c)

function

d)

FUNCTION

3.

function add()

{

$a=10;

echo $a;}

This is an example for

a)

Call by value

b)

Call by reference

c)

None

d)

Both

4.

$a="deepan";

$b="Deepan";

if(strcmp($a,$b))

{

echo "equal";

}

else{

echo " not equal";}

Output is

a)

Equal

b)

Not equal

c)

Error

d)

None

5.

Which one of the following is a form element?

a)

text box.

b)

radio button.

c)

submit button.

d)

All of these.

6.

What is the output of the PHP code.

<?php

if(4>5)

{ print("Hurray.."); }

else

{ print("yes"); }

?>

a)

Yes

b)

hurray..yes

c)

Hurray..Yes

d)

none of the above

7.

What type of language is PHP

a)

Client Side

b)

Server Side

c)

Browser Side

d)

Web Side

8.

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

a)

Variables

b)

Parameters

c)

Code Blocks

d)

Functions

9.

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

10.

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

11.

What is a String?

a)

Text

b)

Number

c)

True

d)

Loop

12.

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

13.

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

14.

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

a)

$colours[0];

b)

$colours[2];

c)

$colours[1]

d)

$colours[3];

15.

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

a)

$name;

b)

include $name;

c)

echo $name;

d)

echo $name

16.

Which of the following is not a component of CRUD?

a)

Create

b)

Read

c)

Update

d)

Drop

17.

Which MySQL command is used to create a new table

a)

CREATE DATABASE

b)

CREATE TABLE

c)

INSERT INTO

d)

SELECT

18.

Which of the following is used to establish a connection to a MySQL database?

a)

mysqli_connect()

b)

mysql_connect()

c)

pdo_connect()

d)

sql_connect()

19.

Which of the following is used to close a connection to a MySQL database?

a)

mysqli_close()

b)

mysql_close()

c)

pdo_close()

d)

sql_close()

20.

Which of the following is used to retrieve the number of rows in a result set?

a)

mysqli_num_rows()

b)

mysql_num_rows()

c)

pdo_num_rows()

d)

sql_num_rows()

21.

Which of the following is used to retrieve the error message associated with the last MySQL operation?

a)

mysqli_error()

b)

mysql_error()

c)

pdo_error()

d)

sql_error()

22.

What is PHP?

a)

PHP: Hyperlink Preprocessor

b)

PHP: Hypertext Preprocessor

c)

PHP: Hyperactive Preprocessor

23.

What software that you need to make PHP project?

a)

NetBeans & C++

b)

NetBeans & XAMPP

c)

Java & XAMPP

24.

Where is your PHP project file located?

a)

C:\xampp\htdocs\

b)

C:\xampp\project\

c)

D:\xampp\htdocs\

25.

The 2 basic ways to get output in PHP are __________.

a)

echo and cout

b)

echo and scan

c)

echo and print

26.

The MySQLi extension, the 'i' stands for __________.

a)

impress

b)

improved

c)

initial

27.

What is the step to create database?

a)

Open localhost/phpmyadmin/

b)

Open NetBeans/New Project/

c)

Open browser/Notepad++

28.

Can PHP read html and CSS file?

a)

YES

b)

NO

c)

MAYBE

29.

XAMPP stand for ________.

a)

Cross-Platform, Apache, MySQL, PHP, and Perl

b)

Unix, Apache, MySQL, PHP, and Python

c)

Cross-Platform, Apache, MySQL, PHP, and Python

30.

In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings:

a)

True

b)

False