Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

yuuphp

Total questions: 25

Worksheet time: 13mins

Name
Class
Date
1.
Question 1: What does PHP stand for?
a)
Private Home Page
b)
Personal Hypertext Processor
c)
PHP: Hypertext Preprocessor
2.
Question 2: PHP server scripts are surrounded by delimiters, which?
a)
<&>...</&>
b)
<script>...</script>
c)
<?php>...</?>
d)
<?php...?>
3.
Question 3: How do you write "Hello World" in PHP
a)
echo "Hello World";
b)
"Hello World";
c)
Document.Write("Hello World");
4.
Question 4: All variables in PHP start with which symbol?
a)
$
b)
&
c)
!
5.
Question 5: What is the correct way to end a PHP statement?
a)
.
b)
;
c)
</php>
d)
New line
6.
Question 6: The PHP syntax is most similar to:
a)
Perl and C
b)
VBScript
c)
JavaScript
7.
Question 7: How do you get information from a form that is submitted using the "get" method?
a)
$_GET[];
b)
Request.QueryString;
c)
Request.Form;
8.
Question 8: When using the POST method, variables are displayed in the URL:
a)
True
b)
False
9.
Question 9: In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings:
a)
False
b)
True
10.
Question 10: Include files must have the file extension ".inc"
a)
True
b)
False
11.
Question 11: What is the correct way to include the file "time.inc" ?
a)
<?php include file="time.inc"; ?>
b)
<!-- include file="time.inc" -->
c)
<?php include:"time.inc"; ?>
d)
<?php include "time.inc"; ?>
12.
Question 12: What is the correct way to create a function in PHP?
a)
new_function myFunction()
b)
function myFunction()
c)
create myFunction()
13.
Question 13: What is the correct way to open the file "time.txt" as readable?
a)
open("time.txt","read");
b)
fopen("time.txt","r");
c)
open("time.txt");
d)
fopen("time.txt","r+");
14.
Question 14: PHP allows you to send emails directly from a script
a)
False
b)
True
15.
Question 15: Which superglobal variable holds information about headers, paths, and script locations?
a)
$_SESSION
b)
$_SERVER
c)
$_GET
d)
$GLOBALS
16.
Question 16: What is the correct way to add 1 to the $count variable?
a)
++count
b)
$count =+1
c)
count++;
d)
$count++;
17.
Question 17: What is a correct way to add a comment in PHP?
a)
*\...\*
b)
<comment>...</comment>
c)
<!--...-->
d)
/*...*/
18.
Question 18: PHP can be run on Microsoft Windows IIS(Internet Information Server):
a)
True
b)
False
19.
Question 19: The die() and exit() functions do the exact same thing.
a)
False
b)
True
20.
Question 20: Which one of these variables has an illegal name?
a)
$my_Var
b)
$my-Var
c)
$myVar
21.
Question 21: How do you create a cookie in PHP?
a)
createcookie
b)
setcookie()
c)
makecookie()
22.
Question 22: In PHP, the only way to output text is with echo.
a)
True
b)
False
23.
Question 23: 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");
24.
Question 24: The if statement is used to execute some code only if a specified condition is true
a)
True
b)
False
25.
Question 25: Which operator is used to check if two values are equal and of same data type?
a)
=
b)
===
c)
==
d)
!=