Easy Tutorial
❮ Func Array Walk Recursive Php Image2Wbmp ❯

PHP curl_getinfo Function

PHP cURL Reference Manual

(PHP 4 >= 4.0.4, PHP 5)

curl_getinfo — Get information regarding a specific cURL transfer


Description

mixed curl_getinfo ( resource $ch [, int $opt = 0 ] )

Retrieve information about the last transfer.


Parameters

ch

A cURL handle returned by curl_init().

opt

This parameter can be one of the following constants:


Return Values

If opt is given, returns its value as a string. Otherwise, returns an associative array with the following elements (which correspond to opt):


Changelog

Version Description
5.1.3 Introduced CURLINFO_HEADER_OUT.

Examples

<?php
// Create a cURL handle
$ch = curl_init('http://www.yahoo.com/');

// Execute
curl_exec($ch);

// Check for errors
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);
?>

PHP cURL Reference Manual

❮ Func Array Walk Recursive Php Image2Wbmp ❯