nerdexam
National_Instruments

200-500 · Question #167

You have a variable $test that contains sub-strings divided by a dash ("-"). How can you put every sub-string into an array element easily?

The correct answer is B. explode("-", $test). See the full explanation below for the reasoning.

Question

You have a variable $test that contains sub-strings divided by a dash ("-"). How can you put every sub-string into an array element easily?

Options

  • Aextract($test, "-");
  • Bexplode("-", $test);
  • Cto_array($test, "-");
  • Dexplode($test, "-");

How the community answered

(31 responses)
  • A
    3% (1)
  • B
    81% (25)
  • C
    6% (2)
  • D
    10% (3)

Community Discussion

No community discussion yet for this question.

Full 200-500 Practice