Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Quizz PHP dasar Kelas 11 PPLG 1

Total questions: 25

Worksheet time: 8mins

Name
Class
Date
1.

apa Kepanjangan dari PHP?

a)

Personal Hypertext Prosesor

b)

PHP: Hypertext Prosesor

c)

Private Home Page

2.

PHP server scripts are surrounded by delimiters, which?

a)

<?php ?>

b)

<?php>..</?>

c)

<&>...</&>

d)

<script>...</script>

3.

How do you write "Hello World" in PHP

a)

echo"Hello Word";

b)

Document.Write("Hello Word");

c)

"Hello Word";

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)

New Line

b)

.

c)

</php>

d)

;

6.

The PHP syntax is most similar to:

a)

JavaScript

b)

Perl and C

c)

VBScript

7.

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

a)

Request.Form;

b)

Request.QueryString;

c)

$_GET[];

8.

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

a)

true

b)

false

9.

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

a)

false

b)

true

10.

Include files must have the file extension ".inc"

a)

true

b)

false

11.

What is the correct way to include the file "time.inc" ?

a)

<?php include "time.inc";?>

b)

<?php include:"time.inc";?>

c)

<?php include file="time.inc";?>

d)

<!--include file="time.ic" -->

12.

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

a)

new_function myFungtion()

b)

function myFungtion()

c)

create myFunction()

13.

What is the correct way to open the file "time.txt" as readable?

a)

open("time.text","read");

b)

fopen("time.text","r+");

c)

fopen("time.text","r");

d)

open("time.txt");

14.

PHP allows you to send emails directly from a script

a)

true

b)

false

15.

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

a)

$_SERVER

b)

$_GLOBAL

c)

$_SESSION

d)

$_GET

16.

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

a)

count++

b)

++count

c)

$count=+1

d)

$coount++

17.

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

a)

<comment>...</comment>

b)

<!--...-->

c)

\*...*\

d)

/.../

18.

PHP can be run on Microsoft Windows IIS(Internet Information Server):

a)

true

b)

false

19.

The die() and exit() functions do the exact same thing.

a)

true

b)

false

20.

Which one of these variables has an illegal name?

a)

$my-var

b)

$my_var

c)

$myVar

21.

How do you create a cookie in PHP?

a)

createcookie

b)

makecookie

c)

setcookie()

22.

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

a)

True

b)

False

23.

How do you create an array in PHP?

a)

$car = array("Honda", "BMW", "Toyota");

b)

$car = array["Honda", "BMW", "Toyota"];

c)

$car = "Honda", "BMW", "Toyota";

24.

The if statement is used to execute some code only if a specified condition is true

a)

true

b)

false

25.

Which operator is used to check if two values are equal and of same data type?

a)

!=

b)

==

c)

===

d)

=