curl_multi_getcontent

(PHP 5)

curl_multi_getcontentReturn the content of a cURL handle if CURLOPT_RETURNTRANSFER is set

Descrierea

string curl_multi_getcontent ( resource $ch )

If CURLOPT_RETURNTRANSFER is an option that is set for a specific handle, then this function will return the content of that cURL handle in the form of a string.

Parametri

ch

Un handle cURL întors de curl_init().

Valorile întoarse

Return the content of a cURL handle if CURLOPT_RETURNTRANSFER is set.

Vedeți de asemenea

add a note add a note

User Contributed Notes 1 note

up
0
butesa at freenet dot de
7 months ago
You can use curl_multi_getcontent() on a curl handle that was executed with curl_exec() (and not added to a multi handle).
However, this is not very useful because curl_multi_getcontent() will return the same as curl_exec() then.

<?php
 $ch
= curl_init('http://www.example.com/');
 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 
$a = curl_exec($ch);
 
$b = curl_multi_getcontent($ch);
 
var_dump($a === $b);
 
curl_close($ch);
?>
will return:

bool(true)
To Top