<<< Previous question <<< Question ID#0608.md >>> Next question >>>
What is wrong with the following code snippet? Assume default configuration values apply.
$fp = fsockopen('www.php.net', 80);
fwrite($fp, "GET / HTTP/1.0\r\nHost: www.php.net\r\n");
$data = fread($fp, 8192);- A) The HTTP request is malformed ( double "\r\n\r\n")
- B) The request is blocking and may cause fread() to hang
- C) This script should be re-written using fgets() instead of fread()
- D) The request is non-blocking and fread() may miss the response
Answer
Answer: A