CPT 283 PHP Programming I: Test 3 Review

¡Supera tus tareas y exámenes ahora con Quizwiz!

timestamp

A ______________ is an integer that represents a date and time as the number of seconds since midnight, January 1, 1970.

closure

A _______________ is a nested function that has access to the outer function's local variables.

key

A foreach loop can be used to get both the ________________ and the value for each element in an associative array.

file

A function library is just a/an ________________ that contains one or more functions.

seconds

A timestamp stores the number of ________________ since midnight on January 1, 1970 GMT.

queue

A/an ________________ is a type of array in which the first element added is the first to be removed.

setDate

After you create a DateTime object, you can use its setTime method to change the time or its ________________ method to change the date.

associative

An array that uses strings as indexes in PHP is known as a(n) ________________ array.

value

By default, all arguments for PHP functions are passed by ________________.

stack

A ________________ is a special type of array that implements a last-in, first-out collection of values?

browser

A cookie is a name/value pair that's stored in a/an __________.

persistent

A cookie that does not expire when the user closes his or her browser is a(n) ________________ cookie.

$_SESSION

A session ID lets PHP associate a user with the data that's stored in the related __________ array.

session_start

A session starts when a browser makes its first request to a page that executes the __________ function.

func_get_args function

All of the arguments that are passed to a function are available in an array that can be accessed by using the ________________.

PHPSESSID

What is the default name of a session cookie in PHP?

parameters

When creating functions, you can include ______________ that are located inside parentheses after the function name.

element

When you use a for loop to process the values in a regular array, the counter value can be used to refer to each ________________ in the array.

array_count_values

Which PHP function is used to count the number of times each value in an array is used?

setcookie

Which PHP function is used to create a cookie?

shuffle

Which PHP function re-orders the values in an array in a random order?

array_merge

Which PHP function returns an array with the elements of two or more arrays in one array?

count

Which PHP function returns the number of elements in an array?

array_sum

Which PHP function returns the sum of the elements in an array?

&

Which character is used before an argument to specify that the variable is being passed to a PHP function by reference?

callback

Which function is passed as an argument to another function?

0

The index value of the first element in a regular PHP array is ________________.

session_destroy

This PHP function can be used to end a session.

Y2K38

Timestamps will encounter a(n) _______ problem if they are not converted to DateTime objects.

DateInterval

One of the methods of a DateTime object lets you add a/an __________ object to it.

True

T/F: A DateInterval object represents an internval of time rather than a point in time.

False

T/F: Bookmarks provide a way for a web application to store information in the user's web browser and retrieve it every time the user requests a page.

2038

Because most systems today store timestamps as 32-bit signed integers, the upper limit of a timestamp on these systems is January 19 in the year________________.

cookie

By default, PHP implements session tracking by using a/an __________ to store a session ID in the user's browser.

24 minutes

If a request is not sent, a session will end by default after __________ have passed.

original variable

If you create a function that passes an argument by reference, the function can change the _______________ without using a return statement.

function

If you create a function with a variable number of parameters, you need to use a PHP ________________ to get an array of the arguments that are passed to the function.

local

If you declare a variable within a function, the variable has ________________ scope.

null

If you use the unset function to delete the value of an element in an array, the value is replaced by a/an ________________ value, thus creating a gap in the array.

scope

In PHP, function name duplications are likely to occur because all functions have global _____________.

True

T/F: Once a session is started, use the $_SESSION autoglobal to get and set the user's data for a session?

True

T/F: When you call a function, you can pass arguments as values that correspond with the parameters of the function.

False

T/F: You can use a foreach loop to access the values of an associative array but not the indexes.

True

T/F: You can use both for loops and foreach loops to work with an array of arrays.

associative

The $_SESSION variable for a session is a/an __________ array.

format

The date function makes it easy to create a timestamp for the current date and ________________ it before returning the value.

DateTime

The use of ________________ objects resolves the Y2K38 problem because the upper limits of dates and times are essentially removed.

delete

To __________ a cookie, set the cookie's value to an empty string and its expiration data to a time in the past.

namespace

To avoid collisions of function names, you can create a/an ________________ for storing your functions.

namespaces

To avoid the duplication of function names, you can use ______________.

arguments

To call a function, you code the function name followed by a set of parentheses that contains a list of the required ________________.

new

To create a DateTime object for the current date, you use the ________________ keyword and pass no arguments to the constructor.

equals

To create a default value for a parameter in the parameter list of a function, you code a/an ________________ sign after the parameter name followed by the default value.

parameters

To create a persistent cookie, set one of the __________ of the setcookie function.

$_COOKIE

To get the value of a cookie, you can use the autoglobal ______________ variable.

string

To refer to an element in an associative array, you use a/an ________________ as the index.

session

When you use session tracking, each HTTP request includes a cookie that stores the __________ ID.

relative

When you use the strtotime function, you can use an absolute template to create a timestamp for the date that you specify, or you can use a ________________ template to create a timestamp for the current date and adjust it based on the offsets that you specify.

array_pop

Which function removes the next element in a LIFO array (also known as a stack)?

diff

Which method of a DateTime object can be used to determine an amount of time between two dates or times?

by reference

Which method of passing a variable allows the function to change the value of the variable?

$secure

Which parameter of the session_set_cookie_params can be set so the cookie is only available on an HTTPS connection?

anonymous

Which type of PHP function does not have a name?

return

Within a function, you can end the function and pass the result back to the calling statement by coding a/an ________________ statement.

global

Within a function, you can use the ________________ keyword if you need to refer to a variable that's declared outside the function.


Conjuntos de estudio relacionados

Module 02 (part 1): Digital Devices

View Set

Module 10 - Drugs and Consciousness - Test

View Set

Greek Civ: Influence of Athenian Democracy on the US

View Set

Integumentary System (Lecture 1/2)

View Set

Chapter 21: Title, Risk, and Insurable Interest

View Set

Spansk glooseprøøve eheh 17.09.17

View Set