Heim >Backend-Entwicklung >PHP-Tutorial >curl_exec 返回值?

curl_exec 返回值?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 20:24:551514Durchsuche

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

回复内容:

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

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

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

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn