nerdexam
Zend

200-530 · Question #18

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

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

Question

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

Exhibit

200-530 question #18 exhibit

Options

  • Ab c d
  • Bd e f
  • Cc d e
  • Da b c

How the community answered

(42 responses)
  • A
    7% (3)
  • B
    81% (34)
  • C
    2% (1)
  • D
    10% (4)

Community Discussion

No community discussion yet for this question.

Full 200-530 Practice