PHP get headers does not work with -

前端 未结 1 1331
时光说笑
时光说笑 2021-01-03 07:30

I\'m trying to get the output of URL headers and it works great with a subdomain example

subdomain.example.com

I will get the normal messag

1条回答
  •  清酒与你
    2021-01-03 08:26

    When you un-supress the warning from get_headers do you get the warning that you can only use get_headers on urls?

    Warning: get_headers(): This function may only be used against URLs
    

    try adding http:// in front of the subdomain. I added a subdomain test-.myserver.loc to my hosts file and was able to get the headers.

    $url = 'http://test-.myserver.loc';
    print_r(get_headers($url))
    

    http://us3.php.net/get_headers

    0 讨论(0)
提交回复
热议问题