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

curl_exec 返回值?

WBOY
Release: 2016-06-06 20:24:55
Original
1434 people have browsed it

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

回复内容:

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

<code class="php">$req = curl_init($url);
curl_setopt($req, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($req); // 保存在 $res 里</code>
Copy after login

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

Related labels:
php
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template