I want know if is possible to get the HTTP error codes and response in case of error instead of false (file get contents error) and error throwed. I'm using file_get_contents on PHP 7.2
I already tried doing this:
$r = file_get_contents("https://somewebsite");
Output:
PHP Warning: file_get_contents(https://somewebsite): failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request
I can get the response code with $http_response_header but $r is false and i want get the error response page.