PHP file_get_contents() and setting request headers

后端 未结 7 964
庸人自扰
庸人自扰 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:36

    Using the php cURL libraries will probably be the right way to go, as this library has more features than the simple file_get_contents(...).

    An example:

    
    

提交回复
热议问题