nerdexam
Zend

200-530 · Question #530

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

  • Ad e
  • Bc d
  • Ca b
  • Db c

How the community answered

(28 responses)
  • A
    11% (3)
  • B
    82% (23)
  • C
    4% (1)
  • D
    4% (1)

Community Discussion

No community discussion yet for this question.

Full 200-530 Practice