Skip to content
Advertisement

Tag: get-headers

PHP get_headers function always HTTP/1.1

The PHP get_headers function returns an array, eventually including a string like HTTP/1.1 200 OK. The URLs I pass to the function are https. For some reason the successful response of get_headers always has HTTP/1.1, but Firefox devtools – network tab says it’s HTTP/2. I call the function like $headers = get_headers(“https://SOME_URL”, 1);. The second parameter just affects the format

Advertisement