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