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