Exam 2 - PHP
An array of arrays
A multidimensional array in PHP is essentially ____.
inherits
A particular instance of an object ____ the methods and properties its class.
local
A variable's scope can be either global or ____.
Index
A(n) ____ is an element's numeric position within an array.
Arithmetic
A(n) ____ operator is used in PHP to perform mathematical calculations.
loop
A(n) ____ statement is a control structure that repeatedly executes a statement or series of statements while a specific condition is TRUE or until a specific condition becomes TRUE.
Instance
An object created from an existing class is called a(n) ___
value
Assignment operators are used to assign a ____ to a variable.
Function members
Class functions are called ____.
hidden
Class members that other programmers do not need access to should be ____.
Data members
Class variables are known as ____.
primitive
Data types that can be assigned only a single value are called ____ types.
Infinite
If you do not include code that changes the value used the by the condition expression, your program will be caught in a ____ loop.
Classes
Objects are organized into ____.
encapsulated
Objects in which all code and required data are contained within the object itself are ____.
$GLOBALS $_SERVER $_REQUEST $_POST $_GET $_FILES $_ENV $_COOKIE $_SESSION not DATABASES
Several predefined variables in PHP are "superglobals", which means that they are always accessible, regardless of scope - and you can access them from any function, class or file without having to do anything special. Select all superglobals
<?PHP ... ?>
The PHP Group recommends you use the standard ____ script delimiters to write PHP code declaration blocks.
FILE_APPEND
The ____ constant instructs PHP to append data to any existing contents in a specified filename instead of overwriting it.
Include
The ____ file is typically saved with a prefix of inc_.
empty()
The ____ function can be used to determine if a variable contains values.
round()
The ____ function can be used to ensure that a number has the appropriate number of decimal places.
file()
The ____ function reads the contents of a text file that stores each individual line as an element of an indexed array.
is_numeric()
The ____ function tests whether a variable contains a numeric data type.
trim()
The ____ function will remove both leading and trailing spaces from a string.
Conditional
The ____ operator executes one of two expressions based on the results of a conditional expression.
Modulus
The ____ operator uses the % symbol to find the remainder of integer division.
require
The ____ statement halts the processing of the web page and displays an error if an include file cannot be found.
period (.)
The concatenation operator in PHP is a ____.
nested
The data values for input elements that use array notation for the value of the name attribute are stored in a ____ array within the $_POST autoglobal array.
PHP: Hypertext Preprocessor
What does PHP stand for?
$_FILES['...']
When a form is posted, information from the uploaded file is stored in the ____ autoglobal array.
Class constructor
When an object from the class is instantiated it automatically calls a(n) ____, which is a special function with the same name as its class.
Name/value
When you click a form's submit button, each field on the form is sent to the Web server as a ____ pair.
value
When you declare a global variable with the global keyword, you do not need to assign the variable a(n) ____.
Scope
When you use a variable in a PHP program, you must be aware of the variable's ____.
get
When you use the ____ method to submit form data to the processing script, the form data is appended to the URL specified by the action attribute.
??
Which of the following terms is not associated with the switch statement?
$_SERVER
Which superglobal variable holds information about headers, paths, and script locations?
Functions
With many programming languages, global variables are automatically available to all parts of your program, including ____
fgetc()
With the exception of the ____ function, each time you call a function that iterates through a text file, the file pointer automatically moves to the next line in the text file.
Multidimensional arrays
You can create ____ that consist of multiple indexes or keys.
count()
You use the ____ function to find the total number of elements in an array.
array_slice()
You use the ____ function to return a portion of an array and assign it to another array.
Methods
____ are functions associated with an object.
Comments
____ are lines you place in your code that do not get executed but provide helpful information such as the name of the script, your name and the date your created the program.
Integer
____ are positive and negative numbers and 0 with no decimal places.
Operators
____ are symbols, such as the (+) symbol that are used in expressions to manipulate operands.
Properties
____ are variables associated with an object.
?... URL
How do you get information from a form that is submitted using the "get" method?
foreach
A ____ statement is used to iterate or loop through the elements in an array.
cookie
A __________ is a small file that the server embeds on the user's computer. Each time the same computer requests a page with a browser, it will send the ______________ too.
Boolean
Logical operators are used for comparing two ____ operands for equality.
array_merge()
Merge two or more arrays with the ____ function.
Interface
Methods and properties that are required for a source program to communicate with an object are referred to as a(n) ____.
two-dimensional array
The most common type of multidimensional array is a(n) ____ array.
Local
The parameters within the parentheses of a function declaration are what kind of variables?
Arrays
The print_r(), var_export(), and var_dump()functions are used with ____ to display the index and value of each element.
+
The symbol ____ appends one array to another.
$_COOKIES
There are security risks using the $_REQUEST autoglobal because it includes the contents of the ____ autoglobal as well as the $_GET and $_POST autoglobals.
public access specifier
To enable anyone to call a class's member function use a(n) ____.