什么是PHP中的cURL? [英] What is cURL in PHP?

查看:162
本文介绍了什么是PHP中的cURL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在PHP中,我在许多PHP项目中看到cURL这个词。它是什么?如何运作?

In PHP, I see the word cURL in many PHP projects. What is it? How does it work?

参考连结:(什么是PHP中的cURL?

推荐答案

cURL 是一个库,可让您在PHP中进行HTTP请求。您需要了解的一切(以及大多数其他扩展程序)可以在 PHP手册

cURL is a library that lets you make HTTP requests in PHP. Everything you need to know about it (and most other extensions) can be found in the PHP manual.


为了使用PHP的cURL函数
,您需要安装»libcurl
包。 PHP要求您使用
libcurl 7.0.2-beta或更高版本。在PHP
4.2.3中,您将需要libcurl版本7.9.0或更高版本。从PHP 4.3.0,你将需要一个libcurl版本
7.9.8或更高版本。 PHP 5.0.0需要libcurl版本7.10.5或更高版本。

In order to use PHP's cURL functions you need to install the » libcurl package. PHP requires that you use libcurl 7.0.2-beta or higher. In PHP 4.2.3, you will need libcurl version 7.9.0 or higher. From PHP 4.3.0, you will need a libcurl version that's 7.9.8 or higher. PHP 5.0.0 requires a libcurl version 7.10.5 or greater.

php.ini 文件中启用 allow_url_fopen

// Make a HTTP GET request and print it (requires allow_url_fopen to be enabled)
print file_get_contents('http://www.example.com/');

这篇关于什么是PHP中的cURL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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