nerdexam
Zend

200-530 · Question #497

You run the following script: <php $array1 = array ("a", "b", "c", "d", "e", "f"); $array2 = array_slice($array1, 2, 2); foreach ( $array2 as $val ) { print "$val"; } ?> What will be the output?

The correct answer is B. c d. See the full explanation below for the reasoning.

Question

You run the following script: <php $array1 = array ("a", "b", "c", "d", "e", "f"); $array2 = array_slice($array1, 2, 2); foreach ( $array2 as $val ) { print "$val"; } ?> What will be the output?

Options

  • Aa b
  • Bc d
  • Cb c
  • Dd e

How the community answered

(18 responses)
  • A
    6% (1)
  • B
    83% (15)
  • D
    11% (2)

Community Discussion

No community discussion yet for this question.

Full 200-530 Practice