PHP Arrays
11. | Which function is used to sort an array in ascending order by value in PHP? |
---|
A. sort()
B. asort()
C. ksort()
D. rsort()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
12. | Which function is used to sort an array in descending order by value in PHP? |
---|
A. sort()
B. asort()
C. ksort()
D. rsort()
View Answer Discuss Work SpaceAnswer: option d
Explanation:
13. | What is the output of the following PHP code snippet? <?php |
---|
A. ["a", "b", "o"]
B. [5, 6, 6]
C. ["apple", "banana", "orange"]
D. None of the above
View Answer Discuss Work SpaceAnswer: option b
Explanation:
14. | What is the output of the following PHP code snippet? <?php |
---|
A. ["apple"]
B. ["banana"]
C. ["orange"]
D. ["banana", "orange"]
View Answer Discuss Work SpaceAnswer: option d
Explanation:
15. | Which of the following is not a valid way to remove an element from an array in PHP? |
---|
A. unset()
B. array_splice()
C. array_remove()
D. array_shift()
View Answer Discuss Work SpaceAnswer: option c
Explanation: