nerdexam
Zend

200-530 · Question #485

You have been given the following PHP script: 1. <?php 2. $a = 'somevalue'; 3. $array = array("a" => "One","b" => "Two", "c" => "Three"); 4. ????????????? 5. echo "\$a = $a; \$b = $b; \$c = $c"; 6…

The correct answer is B. extract($array). See the full explanation below for the reasoning.

Question

You have been given the following PHP script: 1. <?php 2. $a = 'somevalue'; 3. $array = array("a" => "One","b" => "Two", "c" => "Three"); 4. ????????????? 5. echo "\$a = $a; \$b = $b; \$c = $c"; 6. ?> What should you write at line number 4 to get the following output? $a = One; $b = Two; $c = Three

Options

  • Aimplode($array);
  • Bextract($array);
  • Casort($array);
  • Dksort($array);

How the community answered

(40 responses)
  • A
    5% (2)
  • B
    83% (33)
  • C
    3% (1)
  • D
    10% (4)

Community Discussion

No community discussion yet for this question.

Full 200-530 Practice