nerdexam
Zend

200-550 · Question #73

When retrieving data from URLs, what are valid ways to make sure all file_get_contents calls send a certain user agent string? (Choose 2)

The correct answer is A. $default_opts = array('http'=>array('user_agent'=>"My Cool Browser")); $default = C. ini_set('user_agent', "My Cool Browser"). See the full explanation below for the reasoning.

Question

When retrieving data from URLs, what are valid ways to make sure all file_get_contents calls send a certain user agent string? (Choose 2)

Options

  • A$default_opts = array('http'=>array('user_agent'=>"My Cool Browser")); $default =
  • Bstream_context_set_option("user_agent", "My Cool Browser");
  • Cini_set('user_agent', "My Cool Browser");
  • Dstream_context_set_option($context, "http", "user_agent", "My Cool Browser");

How the community answered

(32 responses)
  • A
    75% (24)
  • B
    16% (5)
  • D
    9% (3)

Community Discussion

No community discussion yet for this question.

Full 200-550 Practice