PHP Flashcards

1
Q

What is PHP? What are some of the rules?

A

Server-side technology used to create web application back-ends. Used to build dynamic web pages - working closely with HTML. Every statement in PHP must be terminated with a semicolon. Whitespace is generally ignored when executing PHP code. Keywords are not case sensitive in PHP. As a convention, use the standard casing.

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

What is a dynamic web page?

A

A web page where each visitor to the site gets a customized page that can look different than how the site looks to another visitor. In contrast a static web page will provide the same content to each visitor

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

How do you write comments in PHP?

A

Either # or // can be used to create a single line comment. Use /* to create a multiline comment */

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

How do you embed PHP in HTML?

A

Place PHP code between tags. If you’re in a .php file, just the opening tag - is implied and left out by convention.

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

What does string concatenation mean? How do you concatenate strings?

A

Combining two or more strings together. The concatenation operator is a period.

EX: echo “one” . “two”; // Prints: onetwo

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

How do you declare a variable in PHP?

A

use the dollar sign ($ aka sigil) character before the variable name and assign a value using the assignment operator (=). Variables can contain letters, numbers, and underscore but must start with a letter or underscore. Variable names are case sensitive. We reassign a variable using the assignment operator on a variable that’s already been declared.

EX: $my_name = “Rachel Beacham”;

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