PHP Flashcards
What is PHP? What are some of the rules?
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.
What is a dynamic web page?
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 do you write comments in PHP?
Either # or // can be used to create a single line comment. Use /* to create a multiline comment */
How do you embed PHP in HTML?
Place PHP code between tags. If you’re in a .php file, just the opening tag - is implied and left out by convention.
What does string concatenation mean? How do you concatenate strings?
Combining two or more strings together. The concatenation operator is a period.
EX: echo “one” . “two”; // Prints: onetwo
How do you declare a variable in PHP?
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”;