Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
20 Cards in this Set
- Front
- Back
This tag causes PHP to start interpreting code:
And the short version is: |
<?php ... ?>
<? ... ?> |
|
What are the two types of comment tags?
|
// This is a one-line tag.
/* This is a two line tag. */ |
|
What character must be placed at the end of every PHP statement?
|
A semi-colon (;)
|
|
Which symbol is used to preface all PHP variable names?
|
A dollar sign, with the exception of constants.
|
|
What can a variable store?
|
A string, a number, or other data.
|
|
What is the difference between $variable = 1 and $variable == 1?
|
$variable = 1 is an assignment statement and sets the value
$variable == 1 is a comparison operator |
|
Why are underscores allowed in variable names and hyphens are not?
|
A hyphen is reserved for subtraction operators.
|
|
Are variable names case-sensitive?
|
Yes.
|
|
Can you use spaces in variable names?
|
No.
|
|
How do you convert one variable type to another?
|
PHP will automatically convert variables when referenced.
|
|
What is the difference between ++$j and $j++?
|
There is no difference unless the value is being tested/assigned/passed, in which case ++$j increments before operation and $j++ increments after operation.
|
|
Are the operators && and "and" interchangeable?
|
Usually, except where precedence is important.
&& is higher priority than "and". |
|
How can you create a multiline echo or assignment?
|
"This is
multi-line echo." <<<_WHATEVERUWANT This is a multi-line echo. _WHATEVERUWANT |
|
Can you redefine a constant?
|
No; they retain their value until the program terminates.
|
|
How do you escape a quotation mark?
|
\' or \"
|
|
What is the difference between the echo and print commands?
|
echo is a construct with multiple arguments
print is a PHP function with a single argument |
|
What is the purpose of functions?
|
To separate discrete sections of code into their own self-contained sections, referenced by a single function name.
|
|
How can you make a variable accessible to all parts of a PHP program?
|
By declaring it as global
|
|
If you generate data within a function, how do you convey it to the rest of the program?
|
By returning a value or modifying a global variable
|
|
What is the result of combining a string with a number?
|
Another string
|