(PHP 4 >= 4.0.4, PHP 5)
curl_getinfo — Get information regarding a specific transfer
curl_init()가 반환한 cURL 핸들입니다.
This may be one of the following constants:
If opt is given, returns its value as a string. Otherwise, returns an associative array with the following elements (which correspond to opt ):
버전 | 설명 |
---|---|
5.1.3 | Introduced CURLINFO_HEADER_OUT. |
Example #1 curl_getinfo() example
<?php
// Create a curl handle
$ch = curl_init('http://www.yahoo.com/');
// Execute
curl_exec($ch);
// Check if any error occured
if(!curl_errno($ch))
{
$info = curl_getinfo($ch);
echo 'Took ' . $info['total_time'] . ' seconds to send a request to ' . $info['url'];
}
// Close handle
curl_close($ch);
?>