WorksheetsPHP Quiz 1
Total questions: 20
Worksheet time: 10mins
What type of language is PHP
Client Side
Server Side
Browser Side
Web Side
PHP is executed on
The Server
The Browser
The Website
The Machine
We store small snippets of information inside what?
Functions
Loops
If Statements
Variables
We create re-usable code blocks by placing them inside?
Variables
Parameters
Code Blocks
Functions
Sometimes we only want certain code to execute if a condition is true. How do we test for that?
Loop
If Statement
Integer
Variable
What is a integer?
It's a Whole Number
It's a Decimal Number
It's a True or False Declaration
It's a String of Text
What is a String?
Text
Number
True
Loop
What is a Boolean
It's Just Text
It's a Number
It's Just True
It's True or False
What if we want a block of code to execute several times?
Use a Variable
Use a Function
Use a Loop
Use a Leap
$colours = array("black, blue, Red, Green") - How do I access "Red" ?
$colours[0];
$colours[2];
$colours[1]
$colours[3];
How do I print out the values of the variable "name" ?
$name;
include $name;
echo $name;
echo $name
function sayMyName(name) {} ; - How do I call tat function
sayMyname();
$sayMyName;
$sayMyName();
sayMyName("John")';
What does i++ do ?
Adds the text on to the end of i
Adds i on to the end of something
Adds i on to the existing value of i
Adds 1 to the current value of iThis is a correct answer
What type of variable is this: $isMale = false;
Integer
Boolean
String
char
In an IF statement we can have 2 conditions tested. Which keyword allows this?
Else
if Else
Else if
OR
$a = 4 ; $b = 6; $c = $a + $b; What is the value of variable "c" ?
6
8
10
None
$a = "Ram"; $n = "Kumar"; $fullName = $f + $n; What is the value of $fulName
RamKumar
Ram Kumar
Ram
None
$a = "Ram"; $n = "Kumar"; $fullName = $f . $n; What is the value of $fulName
RamKumar
Ram Kumar
Kumar
None
function declarations can have (a) assigned to them?
Function calls can have____________ inside them.
Parameters
Arguments
Variables
Types
