wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

dfc50193-6B-chapter1,2

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What does PHP acronym stand for?

a)

Protocol Hyperscript Processor

b)

PHP Hyperscript Processor

c)

Protocol Hypertext Preprocessor

d)

PHP Hypertext Preprocessor

2.

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

a)

Leng

b)

substring

c)

strlen

d)

len

3.

Write a correct syntax to include a file named "footer.php".

a)

include ("footer.php");

b)

import("footer.php");

c)

required("footer.php");

d)

export("footer.php");

4.

What is the correct way to end a PHP statement?

a)

New Line

b)

</php>

c)

;

d)

.

5.

When using the POST method, variables are displayed in the URL:

a)

True

b)

False

6.

How do you create a cookie in PHP?

a)

setcookie()

b)

makecookie()

c)

createcookie()

7.

Identify the type of SQL that were used to manipulate database structures, including tables.

a)

Data Manipulation Language (DML)

b)

Data Definition Language (DDL)

c)

Database Management System (DBMS)

d)

Structured Query Language (SQL)

8.

Determine the CORRECT query used to sort the data that retrieves all the records from student table and lists them by class in ascending order.

a)

SELECT * FROM student ORDER class;

b)

SELECT * FROM student ORDER BY class;

c)

SELECT * FROM student ORDER BY ‘class’;

d)

SELECT * FROM student SORT BY class;

9.

Create a session variable named "favcolor".

a)

$session["favcolor"] = "green";

b)

$_SESSION["favcolor"] = "green";

c)

$_SESSION["favcolor"] ["green"];

d)

$SESSION["favcolor"] ="green";

10.

Which method is more secure send the data to server

a)

post

b)

get

c)

request

d)

none

11.

PHP is executed on

a)

The Server

b)

The Browser

c)

The Website

d)

The Machine

12.

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

a)

Variables

b)

Parameters

c)

Code Blocks

d)

Functions

13.

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

14.

PHP server scripts are surrounded by delimiters, which?

a)

<?php...?>  

b)

<?php>...</?>

15.

How do you create an array in PHP?

a)

$cars = "Volvo", "BMW", "Toyota";

b)

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

c)

$cars = array["Volvo", "BMW", "Toyota"];