PHP Flashcards
When clients request a page containing a server-side script, the ______ processes the scripts, then returns the HTML to the client. For example, a PHP page is not processed by the _______. Instead, it’s interpreted by the ______, that can process PHP scripts and then returns the HTML page to the ______.
server, browser, client
What Is The Current Major Version Of PHP?
5.x
When PHP runs its code, it runs from top to bottom.
true
All statements end with a _________ character.
semicolon
The PHP interpreter ignores whitespace.
true
How many data types are there in PHP?
7
Name the 7 data types in PHP.
Integers, Floats, Strings, Arrays, Booleans, Objects, Resources
What built-in internal function outputs the data type?
gettype
Most strings in PHP are “x” base index.
0
$greeting = "Hello World"; $greeting{0} = "J"; // what is the value of $greeting?
Jello World
Anything that is a ___-____ value will always be considered “true”.
non-zero
Anything that’s empty in any way is always considered _____.
false
A ________ is unchangeable whereas a ________ is varying. _________ are something we may eventually want to modify; a temporary storage location for information in a program.
constant, variable
Variables begin with a ______ sign character whereas constants are typically identified by all ____.
dollar, caps
A string is a series of characters, where a character is the same as a byte.
true
A ________ is an identifier (name) for a simple value. As the name suggests, that value cannot change during the execution of the script. A ________ is ____-_________ by default. By convention, ________ identifiers are always_________.
constant, case-sensitive, uppercase
$arr = array(“Apples”, “Oranges”, “Blueberries”);
print_r($arr); // ___ _____ pairs.
Array ( [0] => Apples [1] => Oranges [2] => Blueberries )
key value
$arr = []; // _________ method.
shorthand