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
- AA GET request will be performed on http://example.com/submit.php
- BA POST request will be performed on http://example.com/submit.php
- CAn error will be displayed
How the community answered
(44 responses)- A9% (4)
- B77% (34)
- C14% (6)
Topics
#file_get_contents#stream context#HTTP POST#stream_context_create
Community Discussion
No community discussion yet for this question.