PrepAway - Latest Free Exam Questions & Answers

what are valid ways to make sure all file_get_contents calls send a certain user agent string?

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)

PrepAway - Latest Free Exam Questions & Answers

A.
stream_context_set_option($context, “http”, “user_agent”, “My Cool Browser”);

B.
ini_set(‘user_agent’, “My Cool Browser”);

C.
stream_context_set_option(“user_agent”, “My Cool Browser”);

D.
$default_opts = array(‘http’=>array(‘user_agent’=>”My Cool Browser”)); $default =
stream_context_set_default($default_opts);

One Comment on “what are valid ways to make sure all file_get_contents calls send a certain user agent string?


Leave a Reply

Your email address will not be published. Required fields are marked *