0% found this document useful (0 votes)
80 views7 pages

PHP Quiz

The test taker scored 9 out of 25 (36%) on a PHP quiz. They answered questions correctly about PHP delimiters, writing "Hello World" in PHP, variables starting with $, ending PHP statements with ;, including files, creating functions, opening files, sending emails from PHP scripts, the $_SERVER superglobal, incrementing variables, commenting in PHP, cookies, arrays, and if statements. They were incorrect on questions regarding PHP standing for, GET variables, POST variables, strings, file extensions, includes, file opening, variable names, outputting text, and data type comparison.

Uploaded by

Kirutika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views7 pages

PHP Quiz

The test taker scored 9 out of 25 (36%) on a PHP quiz. They answered questions correctly about PHP delimiters, writing "Hello World" in PHP, variables starting with $, ending PHP statements with ;, including files, creating functions, opening files, sending emails from PHP scripts, the $_SERVER superglobal, incrementing variables, commenting in PHP, cookies, arrays, and if statements. They were incorrect on questions regarding PHP standing for, GET variables, POST variables, strings, file extensions, includes, file opening, variable names, outputting text, and data type comparison.

Uploaded by

Kirutika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

PHP Quiz Results

Score: 9 of 25

36% Correct:

Question 1:
What does PHP stand for?

PHP: Hypertext Preprocessor    Your answer  


Personal Hypertext Processor
Private Home Page

Question 2:
PHP server scripts are surrounded by delimiters, which?

<&>...</&>    Your answer  
<?php...?>    Correct answer  
<script>...</script>
<?php>...</?>

Question 3:
How do you write "Hello World" in PHP

echo "Hello World";    Your answer  


"Hello World";
Document.Write("Hello World");
Question 4:
All variables in PHP start with which symbol?

!    Your answer  
$    Correct answer  
&

Question 5:
What is the correct way to end a PHP statement?

.    Your answer  
New line
;    Correct answer  
</php>

Question 6:
The PHP syntax is most similar to:

JavaScript    Your answer  
VBScript
Perl and C    Correct answer  

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

Request.QueryString;    Your answer  
Request.Form;
$_GET[];    Correct answer  
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:

False    Your answer  
True    Correct answer  

Question 10:
Include files must have the file extension ".inc"

False    Your answer  
True

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

<!-- include file="time.inc" -->    Your answer  


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

Question 12:
What is the correct way to create a function in PHP?
function myFunction()    Your answer  
new_function myFunction()
create myFunction()

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

open("time.txt");    Your answer  
fopen("time.txt","r+");
fopen("time.txt","r");    Correct answer  
open("time.txt","read");

Question 14:
PHP allows you to send emails directly from a script

False    Your answer  
True    Correct answer  

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

$_SESSION    Your answer  
$_GET
$GLOBALS
$_SERVER    Correct answer  

Question 16:
What is the correct way to add 1 to the $count variable?
count++;    Your answer  
++count
$count++;    Correct answer  
$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):

False    Your answer  
True    Correct answer  

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

False    Your answer  
True    Correct answer  

Question 20:
Which one of these variables has an illegal name?

$my_Var    Your answer  
$my-Var    Correct answer  
$myVar

Question 21:
How do you create a cookie in PHP?

createcookie    Your answer  
makecookie()
setcookie()    Correct answer  

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?

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


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

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

False    Your answer  
True    Correct answer  
Question 25:
Which operator is used to check if two values are equal and of same data type?

===    Your answer  
!=
==
=

You might also like