Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A function is a named chunk of code that usually performs a specific task. The f

ID: 3586977 • Letter: A

Question

  A function is a named chunk of code that usually performs a specific task. The function does not execute until called, and you invoke, or call, a function by executing a line of code that contains the function's name and a set of parentheses. built-in string and array function.

QUESTION 1

The array_shift() function adds one or more elements to the beginning of an array.

True

False

QUESTION 2

You use the array_unshift() function to remove the first element of an array.

True

False

QUESTION 3

The array_pop() functions removes the element located at the end of the array.

True

False

QUESTION 4

The array_push() function adds an element to the end of an array.

True

False

QUESTION 5

The array_splice() function splices arrays together and renumbers the array indices.

True

False

QUESTION 6

The unglue() function removes array elements.

True

False

  

QUESTION 7

The unset() function does not renumber the remaining elements in the array.

True

False

QUESTION 8

The array_unique() function removes duplicate values in an array.

True

False

QUESTION 9

There is an internal array pointer that refers to the currently selected array element.

True

False

QUESTION 10

If a value exists in an array the in_array() function returns 'present', otherwise it returns 'absent'.

True

False

QUESTION 11

The array_key_exists() function determines if a given index or key exists.

True

False

QUESTION 12

The array_keys() function returns an indexed array of all the keys in an associative array.

True

False

QUESTION 13

The array_slice() function returns part of an array and assign it to another array.

True

False

QUESTION 14

You will usually sort arrays using sort() and rsort() for associative arrays.

True

False

QUESTION 15

To merge two or more arrays use the array_merge() function.

True

False

Explanation / Answer

1.

The array_shift() function adds one or more elements to the beginning of an array.

False.

2.

You use the array_unshift() function to remove the first element of an array.

True.

3.

The array_pop() functions removes the element located at the end of the array.

True.

4.

The array_push() function adds an element to the end of an array.

True.

5.

The array_splice() function splices arrays together and renumbers the array indices.

False.

6.

The unglue() function removes array elements.

False.

7.

The unset() function does not renumber the remaining elements in the array.

True.

8.

The array_unique() function removes duplicate values in an array.

True.

9.

There is an internal array pointer that refers to the currently selected array element.

True.

10.

If a value exists in an array the in_array() function returns 'present', otherwise it returns 'absent'.

False.

11.

The array_key_exists() function determines if a given index or key exists.

True.

12.

The array_keys() function returns an indexed array of all the keys in an associative array.

True.

13.

The array_slice() function returns part of an array and assign it to another array.

True.

14.

You will usually sort arrays using sort() and rsort() for associative arrays.

True.

15.

To merge two or more arrays use the array_merge() function.

True.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote