nerdexam
Zend

200-710 · Question #96

Consider the following code. What can be said about the call to file_get_contents? $getdata = 'foo=bar'; $opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-type…

The correct answer is B. A POST request will be performed on http://example.com/submit.php. See the full explanation below for the reasoning.

I/O

Question

Consider the following code. What can be said about the call to file_get_contents? $getdata = 'foo=bar'; $opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $getdata ) ); $context = stream_context_create($opts);

Options

How the community answered

(44 responses)
  • A
    9% (4)
  • B
    77% (34)
  • C
    14% (6)

Topics

#file_get_contents#stream context#HTTP POST#stream_context_create

Community Discussion

No community discussion yet for this question.

Full 200-710 Practice