Lesson 1 - PHP Flashcards

1
Q

Basic structure of the code section

A

<?php
coding line;
coding line;
coding line;
?>
(each line needs to end with ;)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

saving php pages

A

all pages which contain PHP code, must
be saved with a PHP extension.
* Eg dbaccess.php

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

where to save the pages

A

inside the www folder (or subfolder) of
the WAMP server.
* Eg C:\wamp64\www\samplesite

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

why is an echo used

A

to output text onto the web page
The syntax is:
echo “the text including any variables”;
(use single quotes)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

to test your file

A

you must view it via localhost
e.g. http://localhost/phpsandbox/myfirst.php

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what are variables

A

variables are named storage spaces where data is stored temporarily

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

manipulating variables

A

Values stored in variables can be manipulated mathematically,
brought together as text, displayed on screen or checked against
other values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

naming variables

A

must start with a $ (only contains letters/no. or underscores

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

assigning a value

A

Syntax is
$variablename = value;
e.g. $myage = 15;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

storing values into variables

A

e.g. $myage = 15;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly