How to make an HTTP request in PHP?

后端 未结 3 2014
不知归路
不知归路 2020-12-21 12:09

I have to send an SMS by making an HTTP request via GET method. The link contains information in the form of GET variables, e.g.

http://www.somelink.com/file         


        
3条回答
  •  没有蜡笔的小新
    2020-12-21 12:33

    I think the easiest way to make an HTTP request via GET method from PHP is using file_get_contents().

    Don’t forget to see the notes section for info on PHP configuration required for this to work. You need to set allow_url_fopen to true in your php.ini.

提交回复
热议问题