What is the purpose of the file_get_contents()?

What is the purpose of the file_get_contents()?
A. To get the errors and exceptions
B. To get the client’s response
C. To get the server’s response
D. To get the data
 
Answer: c
Explanation: The file_get_contents() is a PHP’s native function used to hit the URL and read the server’s response into
a variable $wpt_response:
Code:
$wpt_response = file_get_contents($wpt_url . $urls_to_benchmark[$x]);
This function is similar to file(), except that file_get_contents() returns the file in a string, starting at the specified offset up to maxlen bytes. On failure, file_get_contents() will return FALSE.
 

Tìm kiếm

Back
Top