I am trying to make a get request using file_get_contents and I want to get back the HTTP headers from the response along with the content body. Whenever I try to provide the headers to the function, I get the error "file_get_contents() expects parameter 3 to be resource". I am not sure what I am doing wrong here. This is the code that I am using. Does anyone know what the cause of this is?
$httpOptions = array('http' => array(
'method' => 'GET',
'ignore_errors' => true
$dom = str_get_html(file_get_contents($url, false, $context));