QUESTION 25 \"To perform a reverse sort on an associative array by key and maint
ID: 3587792 • Letter: Q
Question
QUESTION 25
"To perform a reverse sort on an associative array by key and maintain the existing keys, use the _____ function."
ksort()
krsort()
sort()
uk_sort()
QUESTION 26
A multidimensional array in PHP is essentially ____.
an array of arrays
a two-dimensional array
nonexistent
an associative array
QUESTION 27
Which array would result from the execution of this code?
$soups = array("tomato", "onion", "cheese", "chowder");
$c = array_shift($soups);
array("chowder", "tomato", "onion", "cheese");
array("tomato", "onion", "cheese", "chowder");
array("onion", "cheese", "chowder");
array("tomato", "onion", "cheese");
QUESTION 28
What is the output after this code runs?
$soups = array("tomato", "onion", "cheese", "chowder");
$c = array_shift($soups);
echo $c;
onion
cheese
tomato
chowder
QUESTION 29
What does the array look like after this code runs?
$soups = array("tomato", "onion");
array_unshift($soups, "cheese", "chowder");
array("cheese", "chowder", "tomato", "onion")
array("tomato", "onion", "cheese", "chowder")
array("tomato", "onion")
array("cheese", "chowder")
QUESTION 30
What does the array look like after this code runs?
$soups = array("tomato", "onion");
array_push($soups, "cheese", "chowder");
array("tomato", "chowder")
array("cheese", "chowder", "tomato", "onion")
array("tomato", "onion", "cheese", "chowder")
array("onion", "cheese")
QUESTION 31
What does the array look like after this code runs?
$colors = array("tomato", "onion", "cheese", "chowder");
$c = array_pop($colors);
array("onion", "cheese", "chowder")
array("tomato", "cheese", "chowder")
array("tomato", "onion", "chowder")
array("tomato", "onion", "cheese")
QUESTION 32
What prints?
$soups = array("tomato", "onion", "cheese", "chowder");
$c = array_pop($soups); echo $c;
tomato
chowder
onion
cheese
ksort()
krsort()
sort()
uk_sort()
Explanation / Answer
Answers :
QUESTION 25 : krsort()
QUESTION 26 : an array of arrays
QUESTION 27 : array("onion", "cheese", "chowder");
QUESTION 28 : tomato
QUESTION 29 : array("cheese", "chowder", "tomato", "onion")
QUESTION 30 : array("tomato", "onion", "cheese", "chowder")
QUESTION 31 : array("tomato", "onion", "cheese")
QUESTION 32 : chowder
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.