如何在PHP中发出HTTP请求? [英] How to make an HTTP request in PHP?

查看:139
本文介绍了如何在PHP中发出HTTP请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须通过GET方法发出HTTP请求来发送短信。该链接包含GET变量形式的信息,例如

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.php?from=12345&to=67890&message=hello%20there

运行脚本后,必须好像有人点击了链接并激活了短信发送过程。

After I run the script it has to be as if someone clicked the link and activated the SMS sending process.

我找到了一些关于获取请求和卷曲的链接以及什么不是,这一切都让人感到困惑!

I have found some links about get request and curl and what not, it’s all so confusing!

推荐答案

最简单的方法可能是使用cURL。有关示例,请参见 http://codular.com/curl-with-php

The easiest way is probably to use cURL. See http://codular.com/curl-with-php for some examples.

这篇关于如何在PHP中发出HTTP请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆