PHP Flashcards
What array holds the values of submitted form parameters?
$_POST
How to get the URL of the current page (without protocol or hostname).
$_SERVER[PHP_SELF]
eg:
/users/enter.php
What does $_SERVER[PHP_SELF] return
The URL of the current page (without protocol or hostname).
eg:
/users/enter.php
What are the start and end tags of PHP. What are they for?
< ? php and ? >
The PHP engine ignores anything outside of those tags.. You can leave off the end tag at the end of a PHP file.
Can a PHP program have multiple start and end tag pairs?
Yes
Is there only one start php tag?
No, you can also use < ? but support depends on the engine.
Are php keywords case-sensitive?
No, language keywords and function names are not case-sensitive. Variable names ARE! Best practice is to assume everything is.
What is the single-line commenting style?
Either // or #
Does php offer native Unicode support?
No, a string in php is a sequence of bytes and hence only natively supports a 256-character set.
Quotes used to surround a string are technically called…
delimiters
To concatenate two strings?
. (period) operator
What is the exponentiation operator?
**
What is the modulus division operator?
%
Can you use a dash in variable names in PHP?
No, only underscore.
How do you interpolate variables into a string?
“Hello, ${name}”
Use double-quotes. Braces aren’t necessary for this simple example, but prefer them always.