Home > Backend Development > PHP Tutorial > curl_exec 返回值?

curl_exec 返回值?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:24:55
Original
1554 people have browsed it

curl_exec 这个函数返回的数据直接显示在浏览器中了,怎么把数据保存在变量中

回复内容:

curl_exec 这个函数返回的数据直接显示在浏览器中了,怎么把数据保存在变量中

$req = curl_init($url);
curl_setopt($req, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($req); // 保存在 $res 里
Copy after login

直接写个变量赋值不就行了吗$lines_string=curl_exec($ch);没有输出执行,还能直接显示到浏览器中吗?

Related labels:
php
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template