0

I just wonder, what is wrong with this code ?

$opts = array(
  'http'=>array(
    'method'=>"GET",
    'header'=>"Accept-language: en\r\n" .
              "Cookie: foo=bar\r\n"
  )
);

$context = stream_context_create($opts);

// Open the file using the HTTP headers set above
$file = file_get_contents('http://www.example.com/', false, $context);

I got an error Parse error: syntax error, unexpected ''http'' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ')' in example.php on line 2. Any help please

Ephra
  • 111
  • 1
  • 10

0 Answers0