PHP Superglobals and Functions Flashcards

1
Q

contains information about the
server environment and the current request

A

$_SERVER

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

contains any data that was sent to the
script through a GET request.

A

$_GET

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

contains any data that was sent to the
script through a POST request.

A

$_POST

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

contains any uploaded files that were
sent to the script through a POST request. This superglobal is
used when handling file uploads.

A

$_FILES

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

superglobal contains any cookies that were
sent to the script by the client browser.

A

$_COOKIE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

contains any session variables
that have been set

A

$_SESSION

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

superglobal contains the contents of $_GET,
$_POST, and $_COOKIE.

A

$_REQUEST

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

contains any environment variables
that have been set on the server.

A

$_ENV

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

superglobal contains all global variables
that have been defined in the script. It can be used to
access variables from within a function or other local
scope.

A

$GLOBALS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

function is used to find the length of a string.

A

strlen()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

function is used to replace a string with
another string.

A

str_replace()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

function is used to count the number of
elements in an array.

A

count()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

function is used to add one or more
elements to the end of an array.

A

array_push()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

function is used to remove the last
element from an array.

A

array_pop()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

function is used to format a date and time.
Syntax: date(format, timestamp)

A

date()

DATE FUNCTION

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

function is used to convert a string into a
Unix timestamp.strtotime()

A

strtotime()

Date Function

17
Q

function is used to calculate the difference
between two dates.

A

date_diff()

DATE FUNCTION

18
Q

function is used to return the absolute value of
a number.

A

abs()

19
Q

function is used to raise a number to a power.

A

pow()

20
Q

function is used to generate a random number.

A

rand()

21
Q

function is used to establish a
connection with a MySQL database.
Syntax: mysqli_connect(servername, username,
password, dbname)

A

mysqli_connect()

22
Q

function is used to execute a SQL query

A

mysqli_query()

23
Q

function is used to fetch a result
row as an associative array from a MySQL query. The
function takes a result object returned by mysqli_query().

A

mysqli _ fetch _ assoc()

24
Q

function is used to get the
number of rows in a result set returned by a MySQL
query. The function takes a result object returned by
mysqli_query().

A

mysqli _ num _ rows()

25
Q

function is used to close a MySQL
database connection.

A

mysqli_close()

26
Q

is used to check if a variable is set
and not null.

A

isset()

27
Q

function is used to check if a variable is
empty.

A

empty()

28
Q

function is used to display the type and
value of a variable.

A

var_dump()

29
Q

The settype() function is used to set the type of a variable.

A

settype()

30
Q

function is used to convert a variable to an
integer.

A

intval()

31
Q

function is used to remove whitespace or other
characters from the beginning and end of a string.

A

trim()