200-550 200-550

Loading demo links...

Showing 7–9 of 15 questions

Question 7

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)

Select all that apply, then click Submit answer.

  • $default_opts = array('http'=>array('user_agent'=>"My Cool Browser"));
    $default = stream_context_set_default($default_opts);

  • stream_context_set_option("user_agent", "My Cool Browser");

  • ini_set('user_agent', "My Cool Browser");

  • stream_context_set_option($context, "http", "user_agent", "My Cool Browser");

Question 8

Which of the following PHP functions can be used to set the HTTP response code? (Choose 2)

Select all that apply, then click Submit answer.

  • header_add()

  • header()

  • http_set_status()

  • http_response_code()

  • http_header_set()

Question 9

Which of the following functions will allow identifying unique values inside an array?

Select an option, then click Submit answer.

  • array_unique_values

  • array_distinct

  • array_count_values

  • array_intersect

  • array_values