Question: Is the output of this code in descending order, shown vertically, and with spaces between numbers? And what is the output?
- This does not meet all the criteria because the resulting numbers will be "2461122", which is in no particular order.
- This meets the criteria because the
is present and sort() lists in descending order - This does not meet all the criteria because the sort() function sorts an indexed array in ascending order. Thus this code will display "2 4 6 11 22" shown vertically, but the numbers are spaced.
- does not meet all the criteria because the echo simply result in showing the array numbers in the order shown within the $numbers array, which is ascending
Answer: The correct answer of the above question is Option C:This does not meet all the criteria because the sort() function sorts an indexed array in ascending order. Thus this code will display "2 4 6 11 22" shown vertically, but the numbers are spaced.