Which of the following PHP functions can be used to alter the amount of time PHP waits for a stream before timing out during reading or writing?
stream_set_timeout()
Correct:
stream_set_timeout()
Explanation:
Answer option D is correct.
The stream_set_timeout() function alters the amount of time PHP waits for a stream before timing out during reading or writing. When the stream times out, the 'timed_out' key of the array returned by stream_get_meta_data() is set to TRUE. It denotes that the connection has timed out.
Answer option A is incorrect. The stream_get_meta_data() function is used to retrieve header/meta data from streams/file pointers.
Answer option B is incorrect. The stream_set_read_buffer() function is used to set read file buffering on the given stream.
Answer option C is incorrect. This is not a valid PHP function.