PHP Flashcards

1
Q

How do you open and close PHP?

A

Tags such as

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

How do you declare a variable in PHP?

A

Placing a dollar sign ahead of the variable name ($name = “Alan”;)

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

How do you declare a variable in PHP?

A

Placing a dollar sign ahead of the variable name ($variable)

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

What denotes a concatenation in PHP?

A

A full stop ( . )

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

How do you declare a variable in PHP?

A

Placing a dollar sign ahead of the variable name ($variable)

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

How do you comment in PHP?

A
//single line comment
or
/*multiple
line
comment*/
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can you check if a variable has been assigned a value in PHP?

A

Use the isset() function

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

How can you remove a variable in PHP?

A

Use the unset() function

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

What functions can you use to output data in PHP?

A

Echo, print(), and printf()

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

How do you declare an array in PHP?

A

$array[index];

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

Do you need to declare variable types in PHP?

A

No; variables are dynamic

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

How can you check what browser a user is on?

A

Use $_SERVER[“HTTP_USER_AGENT”]

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