nerdexam
Zend

200-530 · Question #398

Consider the following PHP script: <?php $a = array( 1 => 'php', 'Hypertext', 'Preprocessor', 'widely used' => array( 'general' => 'purpose', 'scripting' => 'language', 'that' => 'was', 'originally'…

The correct answer is C. print $a['widely used']['originally'][10]. See the full explanation below for the reasoning.

Question

Consider the following PHP script: <?php $a = array( 1 => 'php', 'Hypertext', 'Preprocessor', 'widely used' => array( 'general' => 'purpose', 'scripting' => 'language', 'that' => 'was', 'originally' => array( 5 => 'designed', 9 => 'for', 'Web development', 4 => 'purpose',))); //write code here ?> What should you write here to print the value 'Web development'?

Options

  • Aprint $a[2][3][3];
  • Bprint $a['widely used']['originally'][0];
  • Cprint $a['widely used']['originally'][10];
  • Dprint $a[widely used][originally][3];

How the community answered

(45 responses)
  • A
    16% (7)
  • B
    4% (2)
  • C
    71% (32)
  • D
    9% (4)

Community Discussion

No community discussion yet for this question.

Full 200-530 Practice