Section 1

Preview this deck

d. $AutoMakers = array("Ford" => "Mustang", "Chevrolet" => "Corvette");

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (19)

Section 1

(19 cards)

d. $AutoMakers = array("Ford" => "Mustang", "Chevrolet" => "Corvette");

Front

7. What is the correct syntax for declaring and initializing an associative array? a. $AutoMakers = array("Ford" . "Mustang", "Chevrolet" . "Corvette"); b. $AutoMakers = array("Ford" = "Mustang", "Chevrolet" = "Corvette"); c. $AutoMakers = array("Ford" > "Mustang", "Chevrolet" > "Corvette"); d. $AutoMakers = array("Ford" => "Mustang", "Chevrolet" => "Corvette");

Back

array_unique()

Front

You can use the function _______ to remove duplicate elements from an array.

Back

associative

Front

PHP includes two types of arrays: indexed and _______.

Back

array_values()

Front

The return value of the _______ function is the renumbered array.

Back

c. rsort() d. krsort()

Front

5. Which of the following functions performs a reverse sort on an array? (Choose all that apply.) a. asort() b. usort() c. rsort() d. krsort()

Back

b. + c. +=

Front

16. Which of the following operators can you use to append one array to another? (Choose all that apply.) a. . b. + c. += d. =>

Back

a. array_shift()

Front

1. Which of the following functions removes the first element from the beginning of an array? a. array_shift() b. array_unshift() c. array_push() d. array_pop()

Back

d. array_pop()

Front

3. Which of the following functions removes the last element from the end of an array? (Choose all that apply.) a. array_shift() b. array_unshift() c. array_push() d. array_pop()

Back

numeric

Front

You refer to the elements in an indexed array by their _______ position

Back

d. array_intersect()

Front

18. Which of the following returns an array of elements that exist in all of the arrays that are compared? a. usort() b. array_common() c. array_diff() d. array_intersect()

Back

alphanumeric

Front

You refer to the elements in an associative array with an _______ key.

Back

d. reset()

Front

10. Which of the following functions moves an array's internal pointer to the first element? a. first() b. top() c. start() d. reset()

Back

c. <input type="text" name='item[quantity]' />

Front

20. Which is the correct Web form syntax for creating the autoglobal element $_POST['item']['quantity']? a. <input type="text" name="item['quantity']" /> b. <input type="text" name='item["quantity"]' /> c. <input type="text" name='item[quantity]' /> d. <input type="text" name="item["quantity"]" />

Back

a. current()

Front

11. Which of the following functions returns the value of an element where an array's internal pointer is positioned? a. current() b. key() c. array() d. array_values()

Back

d. array_key_exists("Ford", $AutoMakers);

Front

13. Which of the following locates a key named "Ford" in an array named $AutoMakers[]? a. array_key_exists($AutoMakers => "Ford"); b. $AutoMakers = array_key_exists("Ford"); c. array_key_exists($AutoMakers, "Ford"); d. array_key_exists("Ford", $AutoMakers);

Back

b. $InterestRates[1][2]

Front

19. Suppose you are working with an indexed two-dimensional array named $InterestRates[][], where each dimension begins with an index of 0. Which of the following refers to the second element in the first dimension and the third element in the second dimension? a. $InterestRates[1],[2] b. $InterestRates[1][2] c. $InterestRates[1, 2] d. $InterestRates[1].[2]

Back

False

Front

9. If you declare an array in PHP and use a starting index other than 0, empty elements are created for each index between 0 and the index value you specify. True or False?

Back

True

Front

17. If you use the array_merge() function with indexed arrays, all elements in one array are appended to another array and renumbered. True or False?

Back

False

Front

5. After removing elements from an array, the unset() function automatically renumbers the remaining elements. True or False?

Back