nerdexam
Zend

200-530 · Question #35

You have got the following array after applying some sorting operation: Array ( [0] => book1.pdf [1] => book11.pdf [2] => book12.pdf [3] => book2.pdf ) However, you wanted to sort the array in the…

The correct answer is D. natsort(). See the full explanation below for the reasoning.

Question

You have got the following array after applying some sorting operation: Array ( [0] => book1.pdf [1] => book11.pdf [2] => book12.pdf [3] => book2.pdf ) However, you wanted to sort the array in the following format: Array ( [3] => book1.pdf [2] => book2.pdf [1] => book11.pdf [0] => book12.pdf ) Which of the following array sorting functions should you use to accomplish the task?

Options

  • Asort()
  • Bksort()
  • Casort()
  • Dnatsort()

How the community answered

(49 responses)
  • A
    2% (1)
  • B
    10% (5)
  • C
    8% (4)
  • D
    80% (39)

Community Discussion

No community discussion yet for this question.

Full 200-530 Practice