nerdexam
Zend

200-530 · Question #149

What piece of code would you use to obtain an array of response headers for a given URL, indexed by their respective names?

The correct answer is D. get_headers($url, 1). See the full explanation below for the reasoning.

Question

What piece of code would you use to obtain an array of response headers for a given URL, indexed by their respective names?

Options

  • Aget_headers($url);
  • Bget_header($url);
  • Cstream_context_get_headers($url);
  • Dget_headers($url, 1);
  • Eget_headers($url, ASSOC_HEADERS);

How the community answered

(34 responses)
  • A
    3% (1)
  • B
    15% (5)
  • C
    3% (1)
  • D
    71% (24)
  • E
    9% (3)

Community Discussion

No community discussion yet for this question.

Full 200-530 Practice