wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PHP Beginners Quiz

Total questions: 15

Worksheet time: 12mins

Name
Class
Date
1.

What does PHP stand for?

a)

Personal Hypertext Processor

b)

Hypertext Preprocessor

c)

Private Home Page

2.

PHP server scripts are surrounded by delimiters, which?

a)

<script>...</script>

b)

<?php...?>

c)

<&>...</&>

d)

<?php>...</?>

3.

How do you write "Hello World" in PHP?

a)

echo "Hello World";

b)

"Hello World";

c)

Document.Write("Hello World");

d)

print "Hello World"

4.

All variables in PHP start with which symbol?

a)

!

b)

$

c)

#

d)

@

5.

What is the correct way to end a PHP statement?

a)

;

b)

</php>

c)

.

d)

New line

6.

How do you get information from a form that is submitted using the "get" method?

a)

Request.QueryString;

b)

$_GET[];

c)

Request.Form;

d)

None of the above

7.

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

a)

TRUE

b)

FALSE

8.

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

a)

FALSE

b)

TRUE

9.

What is the correct way to create a function in PHP?

a)

new_function myFunction()

b)

function myFunction()

c)

create myFunction()

d)

$myFunction()

10.

PHP allows you to send emails directly from a script

a)

TRUE

b)

FALSE

11.

Which superglobal variable holds information about headers, paths, and script locations?

a)

$GLOBALS

b)

$_GET

c)

$_SERVER

d)

$_SESSION

12.

What is the correct way to add 1 to the $count variable?

a)

$count++

b)

$count=+1

c)

count++

d)

++$count

13.

What is a correct way to add a comment in PHP?

a)

/*...*/

b)

<?comment...?>

c)

//

d)

**...**

14.

In PHP, the only way to output text is with echo.

a)

TRUE

b)

FALSE

15.

Fill in the blanks


$conn = new mysqli( (a)   );