PHP file_get_contents() and setting request headers

后端 未结 7 1081
庸人自扰
庸人自扰 2020-11-22 14:29

With PHP, is it possible to send HTTP headers with file_get_contents() ?

I know you can send the user agent from your php.ini file. However

7条回答
  •  执念已碎
    2020-11-22 14:32

    If you don't need HTTPS and curl is not available on your system you could use fsockopen

    This function opens a connection from which you can both read and write like you would do with a normal file handle.

提交回复
热议问题