English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
(PHP 5 >= 5.5.0)
curl_version — Get CURL version information.
array curl_version ([ int $age = CURLVERSION_NOW ] )
Returns version information about CURL.
age
Returns an array related to the following elements:
Index | Value Description |
---|---|
version_number | CURL 24Bit version number |
version | Version number of CURL, in string format |
ssl_version_number | OpenSSL 24 Bit version number |
ssl_version | Version number of OpenSSL, in string format |
libz_version | Version number of zlib, in string format |
host | Information about the host where CURL is compiled |
age | |
features | OneCURL_VERSION_XXXBitmask of constants |
protocols | An array of protocol names supported by CURL |
This example will check which features are available in the 'features' bitmask returned by curl_version() for the current CURL version.
<?php // Get the CURL version array $version = curl_version(); // Use bitfields in the CURL compilation version to check for certain features $bitfields = Array( 'CURL_VERSION_IPV'6', 'CURL_VERSION_KERBEROS'4', 'CURL_VERSION_SSL', 'CURL_VERSION_LIBZ' ); foreach($bitfields as $feature) { echo $feature . ($version['features'] & constant($feature) ? ' matches' : ' does not match'); echo PHP_EOL; } ?>