mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Integrated user notes 97253 and 97254 both by pcdinh at phpvietnam dot net into the manual.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@297829 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
815321d4b0
commit
6b08984abd
1 changed files with 104 additions and 0 deletions
|
@ -54,6 +54,110 @@
|
|||
<para>
|
||||
On success, returns an associative array for the message, &false; on failure.
|
||||
</para>
|
||||
<para>
|
||||
<table>
|
||||
<title>Contents of the returned array</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Key:</entry>
|
||||
<entry>Value:</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><literal>msg</literal></entry>
|
||||
<entry>The <constant>CURLMSG_DONE</constant> constant. Other return values
|
||||
are currently not available.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>result</literal></entry>
|
||||
<entry>One of the <constant>CURLE_*</constant> constants. If everything is
|
||||
OK, the <constant>CURLE_OK</constant> will be the result.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>handle</literal></entry>
|
||||
<entry>Resource of type curl indicates the handle which it concerns.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>A <function>curl_multi_info_read</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$urls = array(
|
||||
"http://www.cnn.com/",
|
||||
"http://www.bbc.co.uk/",
|
||||
"http://www.yahoo.com/"
|
||||
);
|
||||
|
||||
$mh = curl_multi_init();
|
||||
|
||||
foreach ($urls as $i => $url) {
|
||||
$conn[$i] = curl_init($url);
|
||||
curl_setopt($conn[$i], CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_multi_add_handle($mh, $conn[$i]);
|
||||
}
|
||||
|
||||
do {
|
||||
$status = curl_multi_exec($mh, $active);
|
||||
$info = curl_multi_info_read($mh);
|
||||
if (false !== $info) {
|
||||
var_dump($info);
|
||||
}
|
||||
} while ($status === CURLM_CALL_MULTI_PERFORM || $active);
|
||||
|
||||
foreach ($urls as $i => $url) {
|
||||
$res[$i] = curl_multi_getcontent($conn[$i]);
|
||||
curl_close($conn[$i]);
|
||||
}
|
||||
|
||||
var_dump(curl_multi_info_read($mh));
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
array(3) {
|
||||
["msg"]=>
|
||||
int(1)
|
||||
["result"]=>
|
||||
int(0)
|
||||
["handle"]=>
|
||||
resource(5) of type (curl)
|
||||
}
|
||||
array(3) {
|
||||
["msg"]=>
|
||||
int(1)
|
||||
["result"]=>
|
||||
int(0)
|
||||
["handle"]=>
|
||||
resource(7) of type (curl)
|
||||
}
|
||||
array(3) {
|
||||
["msg"]=>
|
||||
int(1)
|
||||
["result"]=>
|
||||
int(0)
|
||||
["handle"]=>
|
||||
resource(6) of type (curl)
|
||||
}
|
||||
bool(false)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
|
|
Loading…
Reference in a new issue