libcurl package. PHP requires libcurl version 7.10.5 or later. As of PHP 7.3.0, version 7.15.5 or later is required. As of PHP 8.0.0, version 7.29.0 or later is required.) // ============================== USING FUNCTIONS (32) // curl_close() - PHP_4 >= PHP_4_0_2, PHP_5, PHP_7, PHP_8 // OFFLINE | curl_copy_handle() - PHP_5, PHP_7, PHP_8 // curl_errno() - PHP_4 >= PHP_4_0_3, PHP_5, PHP_7, PHP_8 // curl_error() - PHP_4 >= PHP_4_0_3, PHP_5, PHP_7, PHP_8 // OFFLINE | curl_escape() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // curl_exec() - PHP_4 >= PHP_4_0_2, PHP_5, PHP_7, PHP_8 // curl_getinfo() - PHP_4 >= PHP_4_0_4, PHP_5, PHP_7, PHP_8 // curl_init() - PHP_4 >= PHP_4_0_2, PHP_5, PHP_7, PHP_8 // OFFLINE | curl_multi_add_handle() - PHP_5, PHP_7, PHP_8 // OFFLINE | curl_multi_close() - PHP_5, PHP_7, PHP_8 // OFFLINE | curl_multi_errno() - PHP_7 >= PHP_7_1_0, PHP_8 // OFFLINE | curl_multi_exec() - PHP_5, PHP_7, PHP_8 // OFFLINE | curl_multi_getcontent() - PHP_5, PHP_7, PHP_8 // OFFLINE | curl_multi_info_read() - PHP_5, PHP_7, PHP_8 // OFFLINE | curl_multi_init() - PHP_5, PHP_7, PHP_8 // OFFLINE | curl_multi_remove_handle() - PHP_5, PHP_7, PHP_8 // OFFLINE | curl_multi_select() - PHP_5, PHP_7, PHP_8 // OFFLINE | curl_multi_setopt() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // OFFLINE | curl_multi_strerror() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // OFFLINE | curl_pause() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // OFFLINE | curl_reset() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // OFFLINE | curl_setopt_array() - PHP_5 >= PHP_5_1_3, PHP_7, PHP_8 // curl_setopt() - PHP_4 >= PHP_4_0_2, PHP_5, PHP_7, PHP_8 // OFFLINE | curl_share_close() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // OFFLINE | curl_share_errno() - PHP_7 >= PHP_7_1_0, PHP_8 // OFFLINE | curl_share_init() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // OFFLINE | curl_share_setopt() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // OFFLINE | curl_share_strerror() - PHP_7 >= PHP_7_1_0, PHP_8 // OFFLINE | curl_strerror() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // OFFLINE | curl_unescape() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // OFFLINE | curl_upkeep() - PHP_8 >= PHP_8_2_0 // curl_version() - PHP_4 >= PHP_4_0_2, PHP_5, PHP_7, PHP_8 // ============================== USING CLASSES (2) // OFFLINE | PHP_OTHER_CURL_CURLFILE - PHP_5 - PHP_8 // OFFLINE | PHP_OTHER_CURL_CURLSTRINGFILE - PHP_8 // ============================== USING DATA_TYPES (13) // void // OFFLINE | CurlHandle - PHP_8 // false // int // string // bool // mixed // OFFLINE | CurlMultiHandle - PHP_8 // array // float // OFFLINE | CurlShareHandle - PHP_8 // OFFLINE | CURLFile - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // OFFLINE | CURLStringFile - PHP_8 >= PHP_8_1_0 // ============================== END // REQUIREMENTS // ============================== // ============================== BEGIN // PHP_OTHER_CURL // ============================== ABOUT // PHP Manual / Function Reference / Other Services / cURL - Client URL Library // URL: https://www.php.net/manual/en/book.curl.php // ============================== DESCRIPTION // CLIENT_URL_LIBRARY // LIBCURL_ERROR_CODES // // CLIENT_URL_LIBRARY - BEGIN // Client URL Library // // INTRODUCTION // INSTALLING_CONFIGURING // PREDEFINED_CONSTANTS // EXAMPLES // CURL_FUNCTIONS // THE_CURLHANDLE_CLASS // THE_CURLMULTIHANDLE_CLASS // THE_CURLSHAREHANDLE_CLASS // THE_CURLFILE_CLASS // THE_CURLSTRINGFILE_CLASS // // INTRODUCTION - BEGIN // Introduction // // PHP supports libcurl, a library created by Daniel Stenberg, that allows you to connect and communicate to many different types of servers with many different types of protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this can also be done with PHP's ftp extension), HTTP form based upload, proxies, cookies, and user+password authentication. // // LITERATURE_SOURCES // * PHP_NET (2023-08-08) // URL: https://www.php.net/manual/en/intro.curl.php // INTRODUCTION - END // // INSTALLING_CONFIGURING - BEGIN // Installing/Configuring // // REQUIREMENTS // INSTALLATION // RUNTIME_CONFIGURATION // RESOURCE_TYPES // // REQUIREMENTS - BEGIN // Requirements // // In order to use PHP's cURL functions you need to install the > libcurl package. PHP requires libcurl version 7.10.5 or later. As of PHP 7.3.0, version 7.15.5 or later is required. As of PHP 8.0.0, version 7.29.0 or later is required. // // LITERATURE_SOURCES // * PHP_NET (2023-08-08) // URL: https://www.php.net/manual/en/curl.requirements.php // REQUIREMENTS - END // // INSTALLATION - BEGIN // Installation // // To use PHP's cURL support you must also compile PHP --with-curl[=DIR] where DIR is the location of the directory containing the lib and include directories. In the include directory there should be a folder named curl which should contain the easy.h and curl.h files. There should be a file named libcurl.a located in the lib directory. // Note: Note to Win32 Users // In order to enable this module on a Windows environment, libeay32.dll and ssleay32.dll, or, as of OpenSSL 1.1 libcrypto-*.dll and libssl-*.dll, must be present in your PATH. Also libssh2.dll must be present in your PATH. You don't need libcurl.dll from the cURL site. // // LITERATURE_SOURCES // * PHP_NET (2023-08-08) // URL: https://www.php.net/manual/en/curl.installation.php // INSTALLATION - END // // RUNTIME_CONFIGURATION - BEGIN // Runtime Configuration // // The behaviour of these functions is affected by settings in php.ini. // // cURL Configuration Options // Name | Default | Changeable | Changelog // curl.cainfo | NULL | PHP_INI_SYSTEM | // // For further details and definitions of the PHP_INI_* modes, see the Where a configuration setting may be set. // Here's a short explanation of the configuration directives. // // curl.cainfo string - A default value for the CURLOPT_CAINFO option. This is required to be an absolute path. // // LITERATURE_SOURCES // * PHP_NET (2023-08-08) // URL: https://www.php.net/manual/en/curl.configuration.php // RUNTIME_CONFIGURATION - END // // RESOURCE_TYPES - BEGIN // Resource Types // // Prior to PHP 8.0.0, this extension defined three resource types: a curl handle, a curl_multi handle, and a curl_share handle. // // LITERATURE_SOURCES // * PHP_NET (2023-08-08) // URL: https://www.php.net/manual/en/curl.resources.php // RESOURCE_TYPES - END // // LITERATURE_SOURCES // * PHP_NET (2023-08-08) // URL: https://www.php.net/manual/en/curl.setup.php // INSTALLING_CONFIGURING - END // // PREDEFINED_CONSTANTS - BEGIN // Predefined Constants // // The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime. // Descriptions and uses for these constants are described within the curl_setopt(), curl_multi_setopt() and curl_getinfo() documentation. // // CURLOPT_AUTOREFERER (int) - // CURLOPT_COOKIESESSION (int) - // CURLOPT_DOH_URL (int) - Provides the DNS-over-HTTPS URL. Available as of PHP 8.1.0 and cURL 7.62.0. // CURLOPT_DOH_SSL_VERIFYHOST (int) - Verify the DNS-over-HTTPS server's SSL certificate name fields against the host name. Available as of PHP 8.2.0 and cURL 7.76.0. // CURLOPT_DOH_SSL_VERIFYPEER (int) - Verify the authenticity of the DNS-over-HTTPS server's SSL certificate. Available as of PHP 8.2.0 and cURL 7.76.0. // CURLOPT_DOH_SSL_VERIFYSTATUS (int) - Tell cURL to verify the status of the DNS-over-HTTPS server certificate using the "Certificate Status Request" TLS extension (OCSP stapling). Available as of PHP 8.2.0 and cURL 7.76.0. // CURLOPT_DNS_USE_GLOBAL_CACHE (int) - // CURLOPT_DNS_CACHE_TIMEOUT (int) - // CURLOPT_FTP_SSL (int) - // CURLFTP_CREATE_DIR (int) - Available since PHP 7.0.7 and cURL 7.19.3 // CURLFTP_CREATE_DIR_NONE (int) - Available since PHP 7.0.7 and cURL 7.19.3 // CURLFTP_CREATE_DIR_RETRY (int) - Available since PHP 7.0.7 and cURL 7.19.3 // CURLFTPSSL_TRY (int) - // CURLFTPSSL_ALL (int) - // CURLFTPSSL_CONTROL (int) - // CURLFTPSSL_NONE (int) - // CURLFTPMETHOD_DEFAULT (int) - Available as of PHP 8.2.0 and cURL 7.15.3. // CURLOPT_PRIVATE (int) - // CURLOPT_FTPSSLAUTH (int) - // CURLOPT_PORT (int) - // CURLOPT_FILE (int) - // CURLOPT_INFILE (int) - // CURLOPT_INFILESIZE (int) - // CURLOPT_ISSUERCERT_BLOB (int) - Issuer SSL certificate from memory blob. Available as of PHP 8.1.0 and cURL 7.71.0. // CURLOPT_URL (int) - // CURLOPT_PROXY (int) - // CURLOPT_PROXY_ISSUERCERT (int) - Proxy issuer SSL certificate filename. Available as of PHP 8.1.0 and cURL 7.71.0. // CURLOPT_PROXY_ISSUERCERT_BLOB (int) - Proxy issuer SSL certificate from memory blob. Available as of PHP 8.1.0 and cURL 7.71.0. // CURLOPT_PROXY_SSLCERT_BLOB (int) - SSL proxy client certificate from memory blob. Available as of PHP 8.1.0 and cURL 7.71.0. // CURLOPT_PROXY_SSLKEY_BLOB (int) - Private key for proxy cert from memory blob. Available as of PHP 8.1.0 and cURL 7.71.0. // CURLOPT_VERBOSE (int) - // CURLOPT_ALTSVC (int) - Available as of PHP 8.2.0 and cURL 7.64.1. // CURLOPT_ALTSVC_CTRL (int) - Available as of PHP 8.2.0 and cURL 7.64.1. // CURLALTSVC_H1 (int) - Available as of PHP 8.2.0 and cURL 7.64.1. // CURLALTSVC_H2 (int) - Available as of PHP 8.2.0 and cURL 7.64.1. // CURLALTSVC_H3 (int) - Available as of PHP 8.2.0 and cURL 7.64.1. // CURLALTSVC_READONLYFILE (int) - Available as of PHP 8.2.0 and cURL 7.64.1. // CURLOPT_HEADER (int) - // CURLOPT_HTTPHEADER (int) - // CURLOPT_NOPROGRESS (int) - // CURLOPT_NOBODY (int) - // CURLOPT_FAILONERROR (int) - // CURLOPT_UPLOAD (int) - // CURLOPT_UPLOAD_BUFFERSIZE (int) - Available as of PHP 8.2.0 and cURL 7.62.0 // CURLOPT_POST (int) - // CURLOPT_FTPLISTONLY (int) - // CURLOPT_FTPAPPEND (int) - // CURLOPT_FTP_CREATE_MISSING_DIRS (int) - // CURLOPT_NETRC (int) - // CURLOPT_FOLLOWLOCATION (int) - This constant is not available when open_basedir is enabled. // CURLOPT_FTPASCII (int) - // CURLOPT_PUT (int) - // CURLOPT_MUTE (int) - Removed as of cURL 7.15.5; use CURLOPT_RETURNTRANSFER instead. // CURLOPT_USERPWD (int) - // CURLOPT_PROXYUSERPWD (int) - // CURLOPT_RANGE (int) - // CURLOPT_TIMEOUT (int) - // CURLOPT_TIMEOUT_MS (int) - // CURLOPT_TCP_NODELAY (int) - // CURLOPT_POSTFIELDS (int) - // CURLOPT_PROGRESSFUNCTION (int) - // CURLOPT_REFERER (int) - // CURLOPT_USERAGENT (int) - // CURLOPT_FTPPORT (int) - // CURLOPT_FTP_USE_EPSV (int) - // CURLOPT_LOW_SPEED_LIMIT (int) - // CURLOPT_LOW_SPEED_TIME (int) - // CURLOPT_RESUME_FROM (int) - // CURLOPT_COOKIE (int) - // CURLOPT_COOKIELIST (int) - Available since cURL 7.14.1 // CURLOPT_SSLCERT (int) - // CURLOPT_SSLCERT_BLOB (int) - SSL client certificate from memory blob. Available as of PHP 8.1.0 and cURL 7.71.0. // CURLOPT_SSLCERTPASSWD (int) - // CURLOPT_SSLKEY_BLOB (int) - Private key for client cert from memory blob. Available as of PHP 8.1.0 and cURL 7.71.0. // CURLOPT_WRITEHEADER (int) - // CURLOPT_SSL_VERIFYHOST (int) - // CURLOPT_COOKIEFILE (int) - // CURLOPT_SSLVERSION (int) - // CURL_SSLVERSION_DEFAULT (int) - // CURL_SSLVERSION_TLSv1 (int) - // CURL_SSLVERSION_SSLv2 (int) - // CURL_SSLVERSION_SSLv3 (int) - // CURL_SSLVERSION_TLSv1_0 (int) - // CURL_SSLVERSION_TLSv1_1 (int) - // CURL_SSLVERSION_TLSv1_2 (int) - // CURL_SSLVERSION_TLSv1_3 (int) - // CURLOPT_TIMECONDITION (int) - // CURLOPT_TIMEVALUE (int) - // CURLOPT_CUSTOMREQUEST (int) - // CURLOPT_STDERR (int) - // CURLOPT_TRANSFERTEXT (int) - // CURLOPT_RETURNTRANSFER (int) - // CURLOPT_QUOTE (int) - // CURLOPT_POSTQUOTE (int) - // CURLOPT_INTERFACE (int) - // CURLOPT_KRB4LEVEL (int) - // CURLOPT_HTTPPROXYTUNNEL (int) - // CURLOPT_FILETIME (int) - // CURLOPT_WRITEFUNCTION (int) - // CURLOPT_READFUNCTION (int) - // CURLOPT_PASSWDFUNCTION (int) - Removed as of PHP 7.3.0. // CURLOPT_HEADERFUNCTION (int) - // CURLOPT_MAXAGE_CONN (int) - Available as of PHP 8.2.0 and cURL 7.65.0 // CURLOPT_MAXFILESIZE_LARGE (int) - Available as of PHP 8.2.0 and cURL 7.11.0 // CURLOPT_MAXLIFETIME_CONN (int) - Available as of PHP 8.2.0 and cURL 7.80.0 // CURLOPT_MAXREDIRS (int) - // CURLOPT_MAXCONNECTS (int) - // CURLOPT_FRESH_CONNECT (int) - // CURLOPT_FORBID_REUSE (int) - // CURLOPT_RANDOM_FILE (int) - // CURLOPT_EGDSOCKET (int) - // CURLOPT_CONNECTTIMEOUT (int) - // CURLOPT_CONNECTTIMEOUT_MS (int) - // CURLOPT_SSL_VERIFYPEER (int) - // CURLOPT_CAINFO (int) - // CURLOPT_CAINFO_BLOB (int) - Available as of PHP 8.2.0 and cURL 7.77.0 // CURLOPT_CAPATH (int) - // CURLOPT_COOKIEJAR (int) - // CURLOPT_SSL_CIPHER_LIST (int) - // CURLOPT_SSL_EC_CURVES (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLOPT_BINARYTRANSFER (int) - // CURLOPT_NOSIGNAL (int) - // CURLOPT_PROXYTYPE (int) - Available as of cURL 7.10. // CURLOPT_BUFFERSIZE (int) - // CURLOPT_HTTPGET (int) - // CURLOPT_HTTP_VERSION (int) - // CURLOPT_HSTS (int) - Available as of PHP 8.2.0 and cURL 7.74.0 // CURLOPT_HSTS_CTRL (int) - Available as of PHP 8.2.0 and cURL 7.74.0 // CURLHSTS_ENABLE (int) - Available as of PHP 8.2.0 and cURL 7.74.0 // CURLHSTS_READONLYFILE (int) - Available as of PHP 8.2.0 and cURL 7.74.0 // CURLOPT_SSLKEY (int) - // CURLOPT_SSLKEYTYPE (int) - // CURLOPT_SSLKEYPASSWD (int) - // CURLOPT_SSLENGINE (int) - // CURLOPT_SSLENGINE_DEFAULT (int) - // CURLOPT_SSLCERTTYPE (int) - // CURLOPT_CRLF (int) - // CURLOPT_ENCODING (int) - // CURLOPT_PROXYPORT (int) - // CURLOPT_UNRESTRICTED_AUTH (int) - // CURLOPT_FTP_USE_EPRT (int) - // CURLOPT_HTTP200ALIASES (int) - // CURLOPT_HTTPAUTH (int) - // CURLOPT_AWS_SIGV4 (int) - Available as of PHP 8.2.0 and cURL 7.75.0 // CURLAUTH_BASIC (int) - // CURLAUTH_DIGEST (int) - // CURLAUTH_GSSNEGOTIATE (int) - // CURLAUTH_NEGOTIATE (int) - Available as of PHP 7.0.7 and cURL 7.38.0. // CURLAUTH_NTLM (int) - // CURLAUTH_NTLM_WB (int) - Available as of PHP 7.0.7 and cURL 7.22.0 // CURLAUTH_ANY (int) - // CURLAUTH_ANYSAFE (int) - // CURLAUTH_AWS_SIGV4 (int) - Available as of PHP 8.2.0 and cURL 7.75.0. // CURLOPT_PROXYAUTH (int) - // CURLOPT_MAIL_RCPT_ALLLOWFAILS (int) - Available as of PHP 8.2.0 and cURL 7.69.0 // CURLOPT_UPKEEP_INTERVAL_MS (int) - Available as of PHP 8.2.0 and cURL 7.62.0 // CURLOPT_MAX_RECV_SPEED_LARGE (int) - Available as of cURL 7.15.5 // CURLOPT_MAX_SEND_SPEED_LARGE (int) - Available as of cURL 7.15.5 // CURLOPT_HEADEROPT (int) - Available as of PHP 7.0.7 and cURL 7.37.0 // CURLOPT_PROXYHEADER (int) - Available as of PHP 7.0.7 and cURL 7.37.0 // CURLINFO_PRIVATE (int) - // CURLINFO_EFFECTIVE_URL (int) - // CURLINFO_HTTP_CODE (int) - As of cURL 7.10.8, this is a legacy alias of CURLINFO_RESPONSE_CODE // CURLINFO_PROXY_ERROR (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_BAD_ADDRESS_TYPE (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_BAD_VERSION (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_CLOSED (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_GSSAPI (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_GSSAPI_PERMSG (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_GSSAPI_PROTECTION (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_IDENTD_DIFFER (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_IDENTD (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_LONG_HOSTNAME (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_LONG_PASSWD (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_LONG_USER (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_NO_AUTH (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_OK (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_RECV_ADDRESS (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_RECV_AUTH (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_RECV_CONNECT (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_RECV_REQACK (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_REPLY_ADDRESS_TYPE_NOT_SUPPORTED (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_REPLY_COMMAND_NOT_SUPPORTED (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_REPLY_CONNECTION_REFUSED (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_REPLY_GENERAL_SERVER_FAILURE (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_REPLY_HOST_UNREACHABLE (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_REPLY_NETWORK_UNREACHABLE (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_REPLY_NOT_ALLOWED (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_REPLY_TTL_EXPIRED (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_REPLY_UNASSIGNED (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_REQUEST_FAILED (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_RESOLVE_HOST (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_SEND_AUTH (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_SEND_CONNECT (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_SEND_REQUEST (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_UNKNOWN_FAIL (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_UNKNOWN_MODE (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLPX_USER_REJECTED (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLINFO_REFERER (int) - Available as of PHP 8.2.0 and cURL 7.76.0 // CURLINFO_RESPONSE_CODE (int) - Available since cURL 7.10.8 // CURLINFO_RETRY_AFTER (int) - Available as of PHP 8.2.0 and cURL 7.66.0 // CURLINFO_HEADER_OUT (int) - // CURLINFO_HEADER_SIZE (int) - // CURLINFO_REQUEST_SIZE (int) - // CURLINFO_TOTAL_TIME (int) - // CURLINFO_NAMELOOKUP_TIME (int) - // CURLINFO_CONNECT_TIME (int) - // CURLINFO_PRETRANSFER_TIME (int) - // CURLINFO_SIZE_UPLOAD (int) - // CURLINFO_SIZE_DOWNLOAD (int) - // CURLINFO_SPEED_DOWNLOAD (int) - // CURLINFO_SPEED_UPLOAD (int) - // CURLINFO_FILETIME (int) - // CURLINFO_SSL_VERIFYRESULT (int) - // CURLINFO_CONTENT_LENGTH_DOWNLOAD (int) - // CURLINFO_CONTENT_LENGTH_UPLOAD (int) - // CURLINFO_STARTTRANSFER_TIME (int) - // CURLINFO_CONTENT_TYPE (int) - // CURLINFO_REDIRECT_TIME (int) - // CURLINFO_REDIRECT_COUNT (int) - // CURLINFO_REDIRECT_URL (int) - // CURLINFO_PRIMARY_IP (int) - // CURLINFO_PRIMARY_PORT (int) - // CURLINFO_LOCAL_IP (int) - // CURLINFO_LOCAL_PORT (int) - // CURL_PUSH_OK (int) - Available since PHP 7.1.0 and cURL 7.44.0 // CURL_PUSH_DENY (int) - Available since PHP 7.1.0 and cURL 7.44.0 // CURL_REDIR_POST_301 (int) - Available since PHP 7.0.7 and cURL 7.18.2 // CURL_REDIR_POST_302 (int) - Available since PHP 7.0.7 and cURL 7.18.2 // CURL_REDIR_POST_303 (int) - Available since PHP 7.0.7 and cURL 7.25.1 // CURL_REDIR_POST_ALL (int) - Available since PHP 7.0.7 and cURL 7.18.2 // CURL_TIMECOND_NONE (int) - // CURL_TIMECOND_IFMODSINCE (int) - // CURL_TIMECOND_IFUNMODSINCE (int) - // CURL_TIMECOND_LASTMOD (int) - // CURL_VERSION_ALTSVC (int) - Available since PHP 7.3.6 and cURL 7.64.1 // CURL_VERSION_ASYNCHDNS (int) - Asynchronous DNS resolves. Available since PHP 7.3.0 and cURL 7.10.7 // CURL_VERSION_BROTLI (int) - Available since PHP 7.3.0 and cURL 7.57.0 // CURL_VERSION_CONV (int) - Character conversions supported. Available since PHP 7.3.0 and cURL 7.15.4 // CURL_VERSION_CURLDEBUG (int) - Debug memory tracking supported. Available since PHP 7.3.6 and cURL 7.19.6 // CURL_VERSION_DEBUG (int) - Built with debug capabilities. Available since PHP 7.3.0 and cURL 7.10.6 // CURL_VERSION_GSASL (int) - Available as of PHP 8.2.0 and cURL 7.76.0 // CURL_VERSION_GSSAPI (int) - Built against a GSS-API library. Available since PHP 7.3.0 and cURL 7.38.0 // CURL_VERSION_GSSNEGOTIATE (int) - Negotiate auth is supported. Available since PHP 7.3.0 and cURL 7.10.6 (deprecated since 7.38.0) // CURL_VERSION_HSTS (int) - Available as of PHP 8.2.0 and cURL 7.74.0 // CURL_VERSION_IDN (int) - Internationized Domain Names are supported. Available since PHP 7.3.0 and cURL 7.12.0 // CURL_VERSION_MULTI_SSL (int) - Available since PHP 7.3.0 and cURL 7.56.0 // CURL_VERSION_NTLM (int) - NTLM auth is supported. Available since PHP 7.3.0 and cURL 7.10.6 // CURL_VERSION_NTLM_WB (int) - NTLM delegation to winbind helper is supported. Available since PHP 7.3.0 and cURL 7.22.0 // CURL_VERSION_IPV6 (int) - IPv6-enabled. // CURL_VERSION_KERBEROS4 (int) - Kerberos V4 auth is supported. // CURL_VERSION_KERBEROS5 (int) - Kerberos V5 auth is supported. Available since PHP 7.0.7 and cURL 7.40.0 // CURL_VERSION_HTTP2 (int) - HTTP2 support built-in. Available since cURL 7.33.0 // CURL_VERSION_HTTP3 (int) - Available as of PHP 8.2.0 and cURL 7.66.0 // CURL_VERSION_LARGEFILE (int) - Supports files larger than 2GB. Available since cURL 7.33.0 // CURL_VERSION_PSL (int) - Mozilla's Public Suffix List, used for cookie domain verification. Available since PHP 7.3.6 and cURL 7.47.0 // CURL_VERSION_SPNEGO (int) - SPNEGO auth is supported. Available since PHP 7.3.0 and cURL 7.10.8 // CURL_VERSION_SSPI (int) - Built against Windows SSPI. Available since PHP 7.3.0 and cURL 7.13.2 // CURL_VERSION_SSL (int) - SSL options are present. // CURL_VERSION_TLSAUTH_SRP (int) - TLS-SRP auth is supported. Available since PHP 7.3.0 and cURL 7.21.4 // CURL_VERSION_UNICODE (int) - Available as of PHP 8.2.0 and cURL 7.72.0 // CURL_VERSION_UNIX_SOCKETS (int) - Unix domain sockets support. Available since PHP 7.0.7 and cURL 7.40.0 // CURL_VERSION_ZSTD (int) - Available as of PHP 8.2.0 and cURL 7.72.0 // CURL_VERSION_LIBZ (int) - libz features are present. // CURLVERSION_NOW (int) - // CURLE_OK (int) - // CURLE_UNSUPPORTED_PROTOCOL (int) - // CURLE_FAILED_INIT (int) - // CURLE_URL_MALFORMAT (int) - // CURLE_URL_MALFORMAT_USER (int) - // CURLE_COULDNT_RESOLVE_PROXY (int) - // CURLE_COULDNT_RESOLVE_HOST (int) - // CURLE_COULDNT_CONNECT (int) - // CURLE_FTP_WEIRD_SERVER_REPLY (int) - // CURLE_FTP_ACCESS_DENIED (int) - // CURLE_FTP_USER_PASSWORD_INCORRECT (int) - // CURLE_FTP_WEIRD_PASS_REPLY (int) - // CURLE_FTP_WEIRD_USER_REPLY (int) - // CURLE_FTP_WEIRD_PASV_REPLY (int) - // CURLE_FTP_WEIRD_227_FORMAT (int) - // CURLE_FTP_CANT_GET_HOST (int) - // CURLE_FTP_CANT_RECONNECT (int) - // CURLE_FTP_COULDNT_SET_BINARY (int) - // CURLE_PARTIAL_FILE (int) - // CURLE_PROXY (int) - Available as of PHP 8.2.0 and cURL 7.73.0 // CURLE_FTP_COULDNT_RETR_FILE (int) - // CURLE_FTP_WRITE_ERROR (int) - // CURLE_FTP_QUOTE_ERROR (int) - // CURLE_HTTP_NOT_FOUND (int) - // CURLE_WRITE_ERROR (int) - // CURLE_MALFORMAT_USER (int) - // CURLE_FTP_COULDNT_STOR_FILE (int) - // CURLE_READ_ERROR (int) - // CURLE_OUT_OF_MEMORY (int) - // CURLE_OPERATION_TIMEOUTED (int) - // CURLE_FTP_COULDNT_SET_ASCII (int) - // CURLE_FTP_PORT_FAILED (int) - // CURLE_FTP_COULDNT_USE_REST (int) - // CURLE_FTP_COULDNT_GET_SIZE (int) - // CURLE_HTTP_RANGE_ERROR (int) - // CURLE_HTTP_POST_ERROR (int) - // CURLE_SSL_CONNECT_ERROR (int) - // CURLE_FTP_BAD_DOWNLOAD_RESUME (int) - // CURLE_FILE_COULDNT_READ_FILE (int) - // CURLE_LDAP_CANNOT_BIND (int) - // CURLE_LDAP_SEARCH_FAILED (int) - // CURLE_LIBRARY_NOT_FOUND (int) - // CURLE_FUNCTION_NOT_FOUND (int) - // CURLE_ABORTED_BY_CALLBACK (int) - // CURLE_BAD_FUNCTION_ARGUMENT (int) - // CURLE_BAD_CALLING_ORDER (int) - // CURLE_HTTP_PORT_FAILED (int) - // CURLE_BAD_PASSWORD_ENTERED (int) - // CURLE_TOO_MANY_REDIRECTS (int) - // CURLE_UNKNOWN_TELNET_OPTION (int) - // CURLE_TELNET_OPTION_SYNTAX (int) - // CURLE_OBSOLETE (int) - // CURLE_SSL_PEER_CERTIFICATE (int) - // CURLE_GOT_NOTHING (int) - // CURLE_SSL_ENGINE_NOTFOUND (int) - // CURLE_SSL_ENGINE_SETFAILED (int) - // CURLE_SEND_ERROR (int) - // CURLE_RECV_ERROR (int) - // CURLE_SHARE_IN_USE (int) - // CURLE_SSL_CERTPROBLEM (int) - // CURLE_SSL_CIPHER (int) - // CURLE_SSL_CACERT (int) - // CURLE_BAD_CONTENT_ENCODING (int) - // CURLE_LDAP_INVALID_URL (int) - // CURLE_FILESIZE_EXCEEDED (int) - // CURLE_FTP_SSL_FAILED (int) - // CURLE_SSH (int) - Available since cURL 7.16.1. // CURLFTPAUTH_DEFAULT (int) - // CURLFTPAUTH_SSL (int) - // CURLFTPAUTH_TLS (int) - // CURLPROXY_HTTP (int) - Available since cURL 7.10. // CURLPROXY_HTTP_1_0 (int) - Available since PHP 7.0.7 and cURL 7.19.3 // CURLPROXY_SOCKS4 (int) - Available since cURL 7.10. // CURLPROXY_SOCKS5 (int) - Available since cURL 7.10. // CURL_NETRC_OPTIONAL (int) - // CURL_NETRC_IGNORED (int) - // CURL_NETRC_REQUIRED (int) - // CURL_HTTP_VERSION_NONE (int) - // CURL_HTTP_VERSION_1_0 (int) - // CURL_HTTP_VERSION_1_1 (int) - // CURL_HTTP_VERSION_2 (int) - Available since PHP 7.0.7 and cURL 7.43.0 // CURL_HTTP_VERSION_2_0 (int) - Available since cURL 7.33.0 // CURL_HTTP_VERSION_2TLS (int) - Available since PHP 7.0.7 and cURL 7.47.0 // CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE (int) - Available since PHP 7.0.7 and cURL 7.49.0 // CURLM_CALL_MULTI_PERFORM (int) - // CURLM_OK (int) - // CURLM_BAD_HANDLE (int) - // CURLM_BAD_EASY_HANDLE (int) - // CURLM_OUT_OF_MEMORY (int) - // CURLM_INTERNAL_ERROR (int) - // CURLMSG_DONE (int) - // CURLOPT_KEYPASSWD (int) - // CURLOPT_SSH_AUTH_TYPES (int) - // CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 (int) - CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 (int) - Available as of PHP 8.2.0 and cURL 7.80.0 // CURLOPT_SSH_PRIVATE_KEYFILE (int) - // CURLOPT_SSH_PUBLIC_KEYFILE (int) - // CURLOPT_SSL_OPTIONS (int) - Available since cURL 7.25.0 // CURLSSLOPT_ALLOW_BEAST (int) - Available since cURL 7.25.0 // CURLSSLOPT_NO_REVOKE (int) - Available since PHP 7.0.7 and cURL 7.44.0 // CURLSSLOPT_AUTO_CLIENT_CERT (int) - Available as of PHP 8.2.0 and cURL 7.77.0 // CURLSSLOPT_NATIVE_CA (int) - Available as of PHP 8.2.0 and cURL 7.71.0 // CURLSSLOPT_NO_PARTIALCHAIN (int) - Available as of PHP 8.2.0 and cURL 7.68.0 // CURLSSLOPT_REVOKE_BEST_EFFORT (int) - Available as of PHP 8.2.0 and cURL 7.70.0 // CURLOPT_USERNAME (int) - Available since cURL 7.19.1 // CURLOPT_SASL_AUTHZID (int) - Available as of PHP 8.2.0 and cURL 7.66.0 // CURLOPT_SASL_IR (int) - Available since PHP 7.0.7 and cURL 7.31.0 // CURLOPT_DNS_INTERFACE (int) - Available since PHP 7.0.7 and cURL 7.33.0 // CURLOPT_DNS_LOCAL_IP4 (int) - Available since PHP 7.0.7 and cURL 7.33.0 // CURLOPT_DNS_LOCAL_IP6 (int) - Available since PHP 7.0.7 and cURL 7.33.0 // CURLOPT_XOAUTH2_BEARER (int) - Available since PHP 7.0.7 and cURL 7.33.0 // CURLOPT_LOGIN_OPTIONS (int) - Available since PHP 7.0.7 and cURL 7.34.0 // CURLOPT_EXPECT_100_TIMEOUT_MS (int) - Available since PHP 7.0.7 and cURL 7.36.0 // CURLOPT_SSL_ENABLE_ALPN (int) - Available since PHP 7.0.7 and cURL 7.36.0 // CURLOPT_SSL_ENABLE_NPN (int) - Available since PHP 7.0.7 and cURL 7.36.0 // CURLOPT_PINNEDPUBLICKEY (int) - Available since PHP 7.0.7 and cURL 7.39.0 // CURLOPT_UNIX_SOCKET_PATH (int) - Available since PHP 7.0.7 and cURL 7.40.0 // CURLOPT_SSL_VERIFYSTATUS (int) - Available since PHP 7.0.7 and cURL 7.41.0 // CURLOPT_PATH_AS_IS (int) - Available since PHP 7.0.7 and cURL 7.42.0 // CURLOPT_SSL_FALSESTART (int) - Available since PHP 7.0.7 and cURL 7.42.0 // CURLOPT_PIPEWAIT (int) - Available since PHP 7.0.7 and cURL 7.43.0 // CURLOPT_PROXY_SERVICE_NAME (int) - Available since PHP 7.0.7 and cURL 7.43.0 // CURLOPT_SERVICE_NAME (int) - Available since PHP 7.0.7 and cURL 7.43.0 // CURLOPT_DEFAULT_PROTOCOL (int) - Available since PHP 7.0.7 and cURL 7.45.0 // CURLOPT_STREAM_WEIGHT (int) - Available since PHP 7.0.7 and cURL 7.46.0 // CURLOPT_TFTP_NO_OPTIONS (int) - Available since PHP 7.0.7 and cURL 7.48.0 // CURLOPT_CONNECT_TO (int) - Available since PHP 7.0.7 and cURL 7.49.0 // CURLOPT_TCP_FASTOPEN (int) - Available since PHP 7.0.7 and cURL 7.49.0 // CURLOPT_TCP_KEEPALIVE (int) - Available since cURL 7.25.0 // CURLOPT_TCP_KEEPIDLE (int) - Available since cURL 7.25.0 // CURLOPT_TCP_KEEPINTVL (int) - Available since cURL 7.25.0 // CURLMOPT_PIPELINING (int) - Available since cURL 7.16.0. // CURLMOPT_MAXCONNECTS (int) - Available since cURL 7.16.3. // CURLMOPT_MAX_CONCURRENT_STREAMS (int) - Available as of PHP 8.2.0 and cURL 7.67.0. // CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE (int) - Available since PHP 7.0.7 and cURL 7.30.0 // CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE (int) - Available since PHP 7.0.7 and cURL 7.30.0 // CURLMOPT_MAX_HOST_CONNECTIONS (int) - Available since PHP 7.0.7 and cURL 7.30.0 // CURLMOPT_MAX_PIPELINE_LENGTH (int) - Available since PHP 7.0.7 and cURL 7.30.0 // CURLMOPT_MAX_TOTAL_CONNECTIONS (int) - Available since PHP 7.0.7 and cURL 7.30.0 // CURLMOPT_PUSHFUNCTION (int) - Available since PHP 7.1.0 and cURL 7.44.0 // CURLSSH_AUTH_AGENT (int) - Available since PHP 7.0.7 and cURL 7.28.0 // CURLSSH_AUTH_ANY (int) - // CURLSSH_AUTH_DEFAULT (int) - // CURLSSH_AUTH_HOST (int) - // CURLSSH_AUTH_KEYBOARD (int) - // CURLSSH_AUTH_NONE (int) - // CURLSSH_AUTH_PASSWORD (int) - // CURLSSH_AUTH_PUBLICKEY (int) - // CURLPAUSE_ALL (int) - Available since cURL 7.18.0. // CURLPAUSE_CONT (int) - Available since cURL 7.18.0. // CURLPAUSE_RECV (int) - Available since cURL 7.18.0. // CURLPAUSE_RECV_CONT (int) - Available since cURL 7.18.0. // CURLPAUSE_SEND (int) - Available since cURL 7.18.0. // CURLPAUSE_SEND_CONT (int) - Available since cURL 7.18.0. // CURLPIPE_NOTHING (int) - Available since cURL 7.43.0. // CURLPIPE_HTTP1 (int) - Available since cURL 7.43.0. // CURLPIPE_MULTIPLEX (int) - Available since cURL 7.43.0. // CURLPROXY_SOCKS4A (int) - Available since cURL 7.18.0. // CURLPROXY_SOCKS5_HOSTNAME (int) - Available since cURL 7.18.0. // CURLHEADER_SEPARATE (int) - Available since PHP 7.0.7 and cURL 7.37.0. // CURLHEADER_UNIFIED (int) - Available since PHP 7.0.7 and cURL 7.37.0. // CURLPROTO_SMB (int) - Available since PHP 7.0.7 and cURL 7.40.0. // CURLPROTO_SMBS (int) - Available since PHP 7.0.7 and cURL 7.40.0. // CURLPROTO_MQTT (int) - Available as of PHP 8.2.0 and cURL 7.71.0. // CURLOPT_REQUEST_TARGET (int) - Available since PHP 7.3.0 and cURL 7.55.0. // CURLAUTH_GSSAPI (int) - Available since PHP 7.3.0 and cURL 7.54.1 // CURLE_WEIRD_SERVER_REPLY (int) - Available since PHP 7.3.0 and cURL 7.51.0 // CURLINFO_CONTENT_LENGTH_DOWNLOAD_T (int) - Available since PHP 7.3.0 and cURL 7.55.0 // CURLINFO_CONTENT_LENGTH_UPLOAD_T (int) - Available since PHP 7.3.0 and cURL 7.55.0 // CURLINFO_HTTP_VERSION (int) - Available since PHP 7.3.0 and cURL 7.50.0 // CURLINFO_PROTOCOL (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLINFO_PROXY_SSL_VERIFYRESULT (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLINFO_SCHEME (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLINFO_SIZE_DOWNLOAD_T (int) - Available since PHP 7.3.0 and cURL 7.50.0 // CURLINFO_SIZE_UPLOAD_T (int) - Available since PHP 7.3.0 and cURL 7.50.0 // CURLINFO_SPEED_DOWNLOAD_T (int) - Available since PHP 7.3.0 and cURL 7.50.0 // CURLINFO_SPEED_UPLOAD_T (int) - Available since PHP 7.3.0 and cURL 7.50.0 // CURL_MAX_READ_SIZE (int) - Available since PHP 7.3.0 and cURL 7.53.0 // CURLOPT_ABSTRACT_UNIX_SOCKET (int) - Available since PHP 7.3.0 and cURL 7.53.0 // CURLOPT_KEEP_SENDING_ON_ERROR (int) - Available since PHP 7.3.0 and cURL 7.51.0 // CURLOPT_PRE_PROXY (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLOPT_PROXY_CAINFO (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLOPT_PROXY_CAINFO_BLOB (int) - Available as of PHP 8.2.0 and cURL 7.77.0 // CURLOPT_PROXY_CAPATH (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLOPT_PROXY_CRLFILE (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLOPT_PROXY_KEYPASSWD (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLOPT_PROXY_PINNEDPUBLICKEY (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLOPT_PROXY_SSLCERT (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLOPT_PROXY_SSLCERTTYPE (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLOPT_PROXY_SSL_CIPHER_LIST (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLOPT_PROXY_SSLKEY (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLOPT_PROXY_SSLKEYTYPE (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLOPT_PROXY_SSL_OPTIONS (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLOPT_PROXY_SSL_VERIFYHOST (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLOPT_PROXY_SSL_VERIFYPEER (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLOPT_PROXY_SSLVERSION (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLOPT_PROXY_TLSAUTH_PASSWORD (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLOPT_PROXY_TLSAUTH_TYPE (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLOPT_PROXY_TLSAUTH_USERNAME (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLOPT_SOCKS5_AUTH (int) - Available since PHP 7.3.0 and cURL 7.55.0 // CURLOPT_SUPPRESS_CONNECT_HEADERS (int) - Available since PHP 7.3.0 and cURL 7.54.0 // CURLPROXY_HTTPS (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURL_SSLVERSION_MAX_DEFAULT (int) - Available since PHP 7.3.0 and cURL 7.54.0 // CURL_SSLVERSION_MAX_NONE (int) - Available since PHP 7.3.0 and cURL 7.54.0 // CURL_SSLVERSION_MAX_TLSv1_0 (int) - Available since PHP 7.3.0 and cURL 7.54.0 // CURL_SSLVERSION_MAX_TLSv1_1 (int) - Available since PHP 7.3.0 and cURL 7.54.0 // CURL_SSLVERSION_MAX_TLSv1_2 (int) - Available since PHP 7.3.0 and cURL 7.54.0 // CURL_SSLVERSION_MAX_TLSv1_3 (int) - Available since PHP 7.3.0 and cURL 7.54.0 // CURL_SSLVERSION_TLSv1_3 (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURL_VERSION_HTTPS_PROXY (int) - Available since PHP 7.3.0 and cURL 7.52.0 // CURLAUTH_BEARER (int) - Available since PHP 7.3.0 and cURL 7.61.0. // CURLINFO_APPCONNECT_TIME_T (int) - Available since PHP 7.3.0 and cURL 7.61.0 // CURLINFO_CONNECT_TIME_T (int) - Available since PHP 7.3.0 and cURL 7.61.0 // CURLINFO_FILETIME_T (int) - Available since PHP 7.3.0 and cURL 7.59.0 // CURLINFO_NAMELOOKUP_TIME_T (int) - Available since PHP 7.3.0 and cURL 7.61.0 // CURLINFO_PRETRANSFER_TIME_T (int) - Available since PHP 7.3.0 and cURL 7.61.0 // CURLINFO_REDIRECT_TIME_T (int) - Available since PHP 7.3.0 and cURL 7.61.0 // CURLINFO_STARTTRANSFER_TIME_T (int) - Available since PHP 7.3.0 and cURL 7.61.0 // CURLINFO_TOTAL_TIME_T (int) - Available since PHP 7.3.0 and cURL 7.61.0 // CURL_LOCK_DATA_CONNECT (int) - Available since PHP 7.3.0 and cURL 7.10.0 // CURL_LOCK_DATA_PSL (int) - Available since PHP 7.3.0 and cURL 7.61.0 // CURLOPT_DISALLOW_USERNAME_IN_URL (int) - Available since PHP 7.3.0 and cURL 7.61.0 // CURLOPT_DNS_SHUFFLE_ADDRESSES (int) - Available since PHP 7.3.0 and cURL 7.60.0 // CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS (int) - Available since PHP 7.3.0 and cURL 7.59.0 // CURLOPT_HAPROXYPROTOCOL (int) - Available since PHP 7.3.0 and cURL 7.60.0 // CURLOPT_PROXY_TLS13_CIPHERS (int) - Available since PHP 7.3.0 and cURL 7.61.0 // CURLOPT_SSH_COMPRESSION (int) - Available since PHP 7.3.0 and cURL 7.56.0 // CURLOPT_TIMEVALUE_LARGE (int) - Available since PHP 7.3.0 and cURL 7.59.0 // CURLOPT_TLS13_CIPHERS (int) - Available since PHP 7.3.0 and cURL 7.61.0 // CURLSSH_AUTH_GSSAPI (int) - Available since PHP 7.3.0 and cURL 7.58.0 // CURLOPT_HTTP09_ALLOWED (int) - Available since PHP 7.3.15 and 7.4.3, respectively, and cURL 7.64.0 // // LITERATURE_SOURCES // * PHP_NET (2023-08-08) // URL: https://www.php.net/manual/en/curl.constants.php // PREDEFINED_CONSTANTS - END // // EXAMPLES - BEGIN // Examples // // BASIC_CURL_EXAMPLE // // BASIC_CURL_EXAMPLE - BEGIN // Basic curl example // // Once you've compiled PHP with cURL support, you can begin using the cURL functions. The basic idea behind the cURL functions is that you initialize a cURL session using the curl_init(), then you can set all your options for the transfer via the curl_setopt(), then you can execute the session with the curl_exec() and then you finish off your session using the curl_close(). Here is an example that uses the cURL functions to fetch the example.com homepage into a file: // [example] // Example #1 Using PHP's cURL module to fetch the example.com homepage // [php] // // $ch = curl_init("http://www.example.com/"); // $fp = fopen("example_homepage.txt", "w"); // // curl_setopt($ch, CURLOPT_FILE, $fp); // curl_setopt($ch, CURLOPT_HEADER, 0); // // curl_exec($ch); // if(curl_error($ch)) { // fwrite($fp, curl_error($ch)); // } // curl_close($ch); // fclose($fp); // [/php] // [/example] // // LITERATURE_SOURCES // * PHP_NET (2023-08-08) // URL: https://www.php.net/manual/en/curl.examples-basic.php // BASIC_CURL_EXAMPLE - END // // LITERATURE_SOURCES // * PHP_NET (2023-08-08) // URL: https://www.php.net/manual/en/curl.examples.php // EXAMPLES - END // // CURL_FUNCTIONS - BEGIN // cURL Functions // // Table of Contents // * curl_close - Close a cURL session // * curl_copy_handle - Copy a cURL handle along with all of its preferences // * curl_errno - Return the last error number // * curl_error - Return a string containing the last error for the current session // * curl_escape - URL encodes the given string // * curl_exec - Perform a cURL session // * curl_getinfo - Get information regarding a specific transfer // * curl_init - Initialize a cURL session // * curl_multi_add_handle - Add a normal cURL handle to a cURL multi handle // * curl_multi_close - Close a set of cURL handles // * curl_multi_errno - Return the last multi curl error number // * curl_multi_exec - Run the sub-connections of the current cURL handle // * curl_multi_getcontent - Return the content of a cURL handle if CURLOPT_RETURNTRANSFER is set // * curl_multi_info_read - Get information about the current transfers // * curl_multi_init - Returns a new cURL multi handle // * curl_multi_remove_handle - Remove a multi handle from a set of cURL handles // * curl_multi_select - Wait for activity on any curl_multi connection // * curl_multi_setopt - Set a cURL multi option // * curl_multi_strerror - Return string describing error code // * curl_pause - Pause and unpause a connection // * curl_reset - Reset all options of a libcurl session handle // * curl_setopt_array - Set multiple options for a cURL transfer // * curl_setopt - Set an option for a cURL transfer // * curl_share_close - Close a cURL share handle // * curl_share_errno - Return the last share curl error number // * curl_share_init - Initialize a cURL share handle // * curl_share_setopt - Set an option for a cURL share handle // * curl_share_strerror - Return string describing the given error code // * curl_strerror - Return string describing the given error code // * curl_unescape - Decodes the given URL encoded string // * curl_upkeep - Performs any connection upkeep checks // * curl_version - Gets cURL version information // // LITERATURE_SOURCES // * PHP_NET (2023-08-08) // URL: https://www.php.net/manual/en/ref.curl.php // CURL_FUNCTIONS - END // // THE_CURLHANDLE_CLASS - BEGIN // The CurlHandle class // // PHP_8 // // Introduction // A fully opaque class which replaces curl resources as of PHP 8.0.0. // // Class synopsis // [code] // final class CurlHandle { // } // [/code] // // LITERATURE_SOURCES // * PHP_NET (2023-11-11) // URL: https://www.php.net/manual/en/class.curlhandle.php // THE_CURLHANDLE_CLASS - END // // THE_CURLMULTIHANDLE_CLASS - BEGIN // The CurlMultiHandle class // // PHP_8 // // Introduction // A fully opaque class which replaces curl_multi resources as of PHP 8.0.0. // // Class synopsis // [code] // final class CurlMultiHandle { // } // [/code] // // LITERATURE_SOURCES // * PHP_NET (2023-11-11) // URL: https://www.php.net/manual/en/class.curlmultihandle.php // THE_CURLMULTIHANDLE_CLASS - END // // THE_CURLSHAREHANDLE_CLASS - BEGIN // The CurlShareHandle class // // PHP_8 // // Introduction // A fully opaque class which replaces curl_share resources as of PHP 8.0.0. // // Class synopsis // [code] // final class CurlShareHandle { // } // [/code] // // LITERATURE_SOURCES // * PHP_NET (2023-11-11) // URL: https://www.php.net/manual/en/class.curlsharehandle.php // THE_CURLSHAREHANDLE_CLASS - END // // THE_CURLFILE_CLASS - BEGIN // The CURLFile class // // PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // // Introduction // This class or CURLStringFile should be used to upload a file with CURLOPT_POSTFIELDS. // Unserialization of CURLFile instances is not allowed. As of PHP 7.4.0, serialization is forbidden in the first place. // // Class synopsis // [code] // class CURLFile { // // /* Properties */ // public string $name = ""; // public string $mime = ""; // public string $postname = ""; // // /* Methods */ // public __construct(string $filename, ?string $mime_type = null, ?string $posted_filename = null) // public getFilename(): string // public getMimeType(): string // public getPostFilename(): string // public setMimeType(string $mime_type): void // public setPostFilename(string $posted_filename): void // } // [/code] // // Properties // name - Name of the file to be uploaded. // mime - MIME type of the file (default is application/octet-stream). // postname - The name of the file in the upload data (defaults to the name property). // // Table of Contents // * CURLFile::__construct - Create a CURLFile object // * CURLFile::getFilename - Get file name // * CURLFile::getMimeType - Get MIME type // * CURLFile::getPostFilename - Get file name for POST // * CURLFile::setMimeType - Set MIME type // * CURLFile::setPostFilename - Set file name for POST // // LITERATURE_SOURCES // * PHP_NET (2023-11-11) // URL: https://www.php.net/manual/en/class.curlfile.php // THE_CURLFILE_CLASS - END // // THE_CURLSTRINGFILE_CLASS - BEGIN // The CURLStringFile class // // PHP_8 >= PHP_8_1_0 // // Introduction // CURLStringFile makes it possible to upload a file directly from a variable. This is similar to CURLFile, but works with the contents of the file, not filename. This class or CURLFile should be used to upload the contents of the file with CURLOPT_POSTFIELDS. // // Class synopsis // [code] // class CURLStringFile { // // /* Properties */ // public string $data; // public string $postname; // public string $mime; // // /* Methods */ // public __construct(string $data, string $postname, string $mime = "application/octet-stream") // } // [/code] // // Properties // data - The contents to be uploaded. // postname - The name of the file to be used in the upload data. // mime - MIME type of the file (default is application/octet-stream). // // Table of Contents // * CURLStringFile::__construct - Create a CURLStringFile object // // LITERATURE_SOURCES // * PHP_NET (2023-11-11) // URL: https://www.php.net/manual/en/class.curlstringfile.php // THE_CURLSTRINGFILE_CLASS - END // // LITERATURE_SOURCES // * PHP_NET (2023-08-08) // URL: https://www.php.net/manual/en/book.curl.php // CLIENT_URL_LIBRARY - END // // LIBCURL_ERROR_CODES - BEGIN // libcurl error codes // // Name // libcurl-errors - error codes in libcurl // // Description // This man page includes most, if not all, available error codes in libcurl. Why they occur and possibly what you can do to fix the problem are also included. // // Curlcode // Almost all "easy" interface functions return a CURLcode error code. No matter what, using the curl_easy_setopt option CURLOPT_ERRORBUFFER is a good idea as it gives you a human readable error string that may offer more details about the cause of the error than just the error code. curl_easy_strerror can be called to get an error string from a given CURLcode number. // // CURLcode is one of the following: // CURLE_OK (0) - All fine. Proceed as usual. // CURLE_UNSUPPORTED_PROTOCOL (1) - The URL you passed to libcurl used a protocol that this libcurl does not support. The support might be a compile-time option that you did not use, it can be a misspelled protocol string or just a protocol libcurl has no code for. // CURLE_FAILED_INIT (2) - Early initialization code failed. This is likely to be an internal error or problem, or a resource problem where something fundamental could not get done at init time. // CURLE_URL_MALFORMAT (3) - The URL was not properly formatted. // CURLE_NOT_BUILT_IN (4) - A requested feature, protocol or option was not found built-in in this libcurl due to a build-time decision. This means that a feature or option was not enabled or explicitly disabled when libcurl was built and in order to get it to function you have to get a rebuilt libcurl. // CURLE_COULDNT_RESOLVE_PROXY (5) - Could not resolve proxy. The given proxy host could not be resolved. // CURLE_COULDNT_RESOLVE_HOST (6) - Could not resolve host. The given remote host was not resolved. // CURLE_COULDNT_CONNECT (7) - Failed to connect() to host or proxy. // CURLE_WEIRD_SERVER_REPLY (8) - The server sent data libcurl could not parse. This error code was known as CURLE_FTP_WEIRD_SERVER_REPLY before 7.51.0. // CURLE_REMOTE_ACCESS_DENIED (9) - We were denied access to the resource given in the URL. For FTP, this occurs while trying to change to the remote directory. // CURLE_FTP_ACCEPT_FAILED (10) - While waiting for the server to connect back when an active FTP session is used, an error code was sent over the control connection or similar. // CURLE_FTP_WEIRD_PASS_REPLY (11) - After having sent the FTP password to the server, libcurl expects a proper reply. This error code indicates that an unexpected code was returned. // CURLE_FTP_ACCEPT_TIMEOUT (12) - During an active FTP session while waiting for the server to connect, the CURLOPT_ACCEPTTIMEOUT_MS (or the internal default) timeout expired. // CURLE_FTP_WEIRD_PASV_REPLY (13) - libcurl failed to get a sensible result back from the server as a response to either a PASV or a EPSV command. The server is flawed. // CURLE_FTP_WEIRD_227_FORMAT (14) - FTP servers return a 227-line as a response to a PASV command. If libcurl fails to parse that line, this return code is passed back. // CURLE_FTP_CANT_GET_HOST (15) - An internal failure to lookup the host used for the new connection. // CURLE_HTTP2 (16) - A problem was detected in the HTTP2 framing layer. This is somewhat generic and can be one out of several problems, see the error buffer for details. // CURLE_FTP_COULDNT_SET_TYPE (17) - Received an error when trying to set the transfer mode to binary or ASCII. // CURLE_PARTIAL_FILE (18) - A file transfer was shorter or larger than expected. This happens when the server first reports an expected transfer size, and then delivers data that does not match the previously given size. // CURLE_FTP_COULDNT_RETR_FILE (19) - This was either a weird reply to a 'RETR' command or a zero byte transfer complete. // Obsolete error (20) - Not used in modern versions. // CURLE_QUOTE_ERROR (21) - When sending custom "QUOTE" commands to the remote server, one of the commands returned an error code that was 400 or higher (for FTP) or otherwise indicated unsuccessful completion of the command. // CURLE_HTTP_RETURNED_ERROR (22) - This is returned if CURLOPT_FAILONERROR is set TRUE and the HTTP server returns an error code that is >= 400. // CURLE_WRITE_ERROR (23) - An error occurred when writing received data to a local file, or an error was returned to libcurl from a write callback. // Obsolete error (24) - Not used in modern versions. // CURLE_UPLOAD_FAILED (25) - Failed starting the upload. For FTP, the server typically denied the STOR command. The error buffer usually contains the server's explanation for this. // CURLE_READ_ERROR (26) - There was a problem reading a local file or an error returned by the read callback. // CURLE_OUT_OF_MEMORY (27) - A memory allocation request failed. This is serious badness and things are severely screwed up if this ever occurs. // CURLE_OPERATION_TIMEDOUT (28) - Operation timeout. The specified time-out period was reached according to the conditions. // Obsolete error (29) - Not used in modern versions. // CURLE_FTP_PORT_FAILED (30) - The FTP PORT command returned error. This mostly happens when you have not specified a good enough address for libcurl to use. See CURLOPT_FTPPORT. // CURLE_FTP_COULDNT_USE_REST (31) - The FTP REST command returned error. This should never happen if the server is sane. // Obsolete error (32) - Not used in modern versions. // CURLE_RANGE_ERROR (33) - The server does not support or accept range requests. // CURLE_HTTP_POST_ERROR (34) - This is an odd error that mainly occurs due to internal confusion. // CURLE_SSL_CONNECT_ERROR (35) - A problem occurred somewhere in the SSL/TLS handshake. You really want the error buffer and read the message there as it pinpoints the problem slightly more. Could be certificates (file formats, paths, permissions), passwords, and others. // CURLE_BAD_DOWNLOAD_RESUME (36) - The download could not be resumed because the specified offset was out of the file boundary. // CURLE_FILE_COULDNT_READ_FILE (37) - A file given with FILE:// could not be opened. Most likely because the file path does not identify an existing file. Did you check file permissions? // CURLE_LDAP_CANNOT_BIND (38) - LDAP cannot bind. LDAP bind operation failed. // CURLE_LDAP_SEARCH_FAILED (39) - LDAP search failed. // Obsolete error (40) - Not used in modern versions. // CURLE_FUNCTION_NOT_FOUND (41) - Function not found. A required zlib function was not found. // CURLE_ABORTED_BY_CALLBACK (42) - Aborted by callback. A callback returned "abort" to libcurl. // CURLE_BAD_FUNCTION_ARGUMENT (43) - A function was called with a bad parameter. // Obsolete error (44) - Not used in modern versions. // CURLE_INTERFACE_FAILED (45) - Interface error. A specified outgoing interface could not be used. Set which interface to use for outgoing connections' source IP address with CURLOPT_INTERFACE. // Obsolete error (46) - Not used in modern versions. // CURLE_TOO_MANY_REDIRECTS (47) - Too many redirects. When following redirects, libcurl hit the maximum amount. Set your limit with CURLOPT_MAXREDIRS. // CURLE_UNKNOWN_OPTION (48) - An option passed to libcurl is not recognized/known. Refer to the appropriate documentation. This is most likely a problem in the program that uses libcurl. The error buffer might contain more specific information about which exact option it concerns. // CURLE_SETOPT_OPTION_SYNTAX (49) - An option passed in to a setopt was wrongly formatted. See error message for details about what option. // Obsolete errors (50-51) - Not used in modern versions. // CURLE_GOT_NOTHING (52) - Nothing was returned from the server, and under the circumstances, getting nothing is considered an error. // CURLE_SSL_ENGINE_NOTFOUND (53) - The specified crypto engine was not found. // CURLE_SSL_ENGINE_SETFAILED (54) - Failed setting the selected SSL crypto engine as default. // CURLE_SEND_ERROR (55) - Failed sending network data. // CURLE_RECV_ERROR (56) - Failure with receiving network data. // Obsolete error (57) - Not used in modern versions. // CURLE_SSL_CERTPROBLEM (58) - problem with the local client certificate. // CURLE_SSL_CIPHER (59) - Could not use specified cipher. // CURLE_PEER_FAILED_VERIFICATION (60) - The remote server's SSL certificate or SSH fingerprint was deemed not OK. This error code has been unified with CURLE_SSL_CACERT since 7.62.0. Its previous value was 51. // CURLE_BAD_CONTENT_ENCODING (61) - Unrecognized transfer encoding. // Obsolete error (62) - Not used in modern versions. // CURLE_FILESIZE_EXCEEDED (63) - Maximum file size exceeded. // CURLE_USE_SSL_FAILED (64) - Requested FTP SSL level failed. // CURLE_SEND_FAIL_REWIND (65) - When doing a send operation curl had to rewind the data to retransmit, but the rewinding operation failed. // CURLE_SSL_ENGINE_INITFAILED (66) - Initiating the SSL Engine failed. // CURLE_LOGIN_DENIED (67) - The remote server denied curl to login (Added in 7.13.1) // CURLE_TFTP_NOTFOUND (68) - File not found on TFTP server. // CURLE_TFTP_PERM (69) - Permission problem on TFTP server. // CURLE_REMOTE_DISK_FULL (70) - Out of disk space on the server. // CURLE_TFTP_ILLEGAL (71) - Illegal TFTP operation. // CURLE_TFTP_UNKNOWNID (72) - Unknown TFTP transfer ID. // CURLE_REMOTE_FILE_EXISTS (73) - File already exists and is not overwritten. // CURLE_TFTP_NOSUCHUSER (74) - This error should never be returned by a properly functioning TFTP server. // Obsolete error (75-76) - Not used in modern versions. // CURLE_SSL_CACERT_BADFILE (77) - Problem with reading the SSL CA cert (path? access rights?) // CURLE_REMOTE_FILE_NOT_FOUND (78) - The resource referenced in the URL does not exist. // CURLE_SSH (79) - An unspecified error occurred during the SSH session. // CURLE_SSL_SHUTDOWN_FAILED (80) - Failed to shut down the SSL connection. // CURLE_AGAIN (81) - Socket is not ready for send/recv wait till it's ready and try again. This return code is only returned from curl_easy_recv and curl_easy_send (Added in 7.18.2) // CURLE_SSL_CRL_BADFILE (82) - Failed to load CRL file (Added in 7.19.0) // CURLE_SSL_ISSUER_ERROR (83) - Issuer check failed (Added in 7.19.0) // CURLE_FTP_PRET_FAILED (84) - The FTP server does not understand the PRET command at all or does not support the given argument. Be careful when using CURLOPT_CUSTOMREQUEST, a custom LIST command is sent with the PRET command before PASV as well. (Added in 7.20.0) // CURLE_RTSP_CSEQ_ERROR (85) - Mismatch of RTSP CSeq numbers. // CURLE_RTSP_SESSION_ERROR (86) - Mismatch of RTSP Session Identifiers. // CURLE_FTP_BAD_FILE_LIST (87) - Unable to parse FTP file list (during FTP wildcard downloading). // CURLE_CHUNK_FAILED (88) - Chunk callback reported error. // CURLE_NO_CONNECTION_AVAILABLE (89) - (For internal use only, is never returned by libcurl) No connection available, the session is queued. (added in 7.30.0) // CURLE_SSL_PINNEDPUBKEYNOTMATCH (90) - Failed to match the pinned key specified with CURLOPT_PINNEDPUBLICKEY. // CURLE_SSL_INVALIDCERTSTATUS (91) - Status returned failure when asked with CURLOPT_SSL_VERIFYSTATUS. // CURLE_HTTP2_STREAM (92) - Stream error in the HTTP/2 framing layer. // CURLE_RECURSIVE_API_CALL (93) - An API function was called from inside a callback. // CURLE_AUTH_ERROR (94) - An authentication function returned an error. // CURLE_HTTP3 (95) - A problem was detected in the HTTP/3 layer. This is somewhat generic and can be one out of several problems, see the error buffer for details. // CURLE_QUIC_CONNECT_ERROR (96) - QUIC connection error. This error may be caused by an SSL library error. QUIC is the protocol used for HTTP/3 transfers. // CURLE_PROXY (97) - Proxy handshake error. CURLINFO_PROXY_ERROR provides extra details on the specific problem. // CURLE_SSL_CLIENTCERT (98) - SSL Client Certificate required. // CURLE_UNRECOVERABLE_POLL (99) - An internal call to poll() or select() returned error that is not recoverable. // CURLE_OBSOLETE* - These error codes are never returned. They were used in an old libcurl version and are currently unused. // // Curlmcode // This is the generic return code used by functions in the libcurl multi interface. Also consider curl_multi_strerror. // CURLM_CALL_MULTI_PERFORM (-1) - This is not really an error. It means you should call curl_multi_perform again without doing select() or similar in between. Before version 7.20.0 (released on February 9 2010) this could be returned by curl_multi_perform, but in later versions this return code is never used. // CURLM_CALL_MULTI_SOCKET (-1) - An alias for CURLM_CALL_MULTI_PERFORM. Never returned by modern libcurl versions. // CURLM_OK (0) - Things are fine. // CURLM_BAD_HANDLE (1) - The passed-in handle is not a valid CURLM handle. // CURLM_BAD_EASY_HANDLE (2) - An easy handle was not good/valid. It could mean that it is not an easy handle at all, or possibly that the handle already is in use by this or another multi handle. // CURLM_OUT_OF_MEMORY (3) - You are doomed. // CURLM_INTERNAL_ERROR (4) - This can only be returned if libcurl bugs. Please report it to us! // CURLM_BAD_SOCKET (5) - The passed-in socket is not a valid one that libcurl already knows about. (Added in 7.15.4) // CURLM_UNKNOWN_OPTION (6) - curl_multi_setopt() with unsupported option (Added in 7.15.4) // CURLM_ADDED_ALREADY (7) - An easy handle already added to a multi handle was attempted to get added a second time. (Added in 7.32.1) // CURLM_RECURSIVE_API_CALL (8) - An API function was called from inside a callback. // CURLM_WAKEUP_FAILURE (9) - Wake up is unavailable or failed. // CURLM_BAD_FUNCTION_ARGUMENT (10) - A function was called with a bad parameter. // CURLM_ABORTED_BY_CALLBACK (11) - A multi handle callback returned error. // CURLM_UNRECOVERABLE_POLL (12) - An internal call to poll() or select() returned error that is not recoverable. // // Curlshcode // The "share" interface returns a CURLSHcode to indicate when an error has occurred. Also consider curl_share_strerror. // CURLSHE_OK (0) - All fine. Proceed as usual. // CURLSHE_BAD_OPTION (1) - An invalid option was passed to the function. // CURLSHE_IN_USE (2) - The share object is currently in use. // CURLSHE_INVALID (3) - An invalid share object was passed to the function. // CURLSHE_NOMEM (4) - Not enough memory was available. (Added in 7.12.0) // CURLSHE_NOT_BUILT_IN (5) - The requested sharing could not be done because the library you use do not have that particular feature enabled. (Added in 7.23.0) // // Curlucode // The URL interface returns a CURLUcode to indicate when an error has occurred. Also consider curl_url_strerror. // CURLUE_OK (0) - All fine. Proceed as usual. // CURLUE_BAD_HANDLE (1) - An invalid URL handle was passed as argument. // CURLUE_BAD_PARTPOINTER (2) - An invalid 'part' argument was passed as argument. // CURLUE_MALFORMED_INPUT (3) - A malformed input was passed to a URL API function. // CURLUE_BAD_PORT_NUMBER (4) - The port number was not a decimal number between 0 and 65535. // CURLUE_UNSUPPORTED_SCHEME (5) - This libcurl build does not support the given URL scheme. // CURLUE_URLDECODE (6) - URL decode error, most likely because of rubbish in the input. // CURLUE_OUT_OF_MEMORY (7) - A memory function failed. // CURLUE_USER_NOT_ALLOWED (8) - Credentials was passed in the URL when prohibited. // CURLUE_UNKNOWN_PART (9) - An unknown part ID was passed to a URL API function. // CURLUE_NO_SCHEME (10) - There is no scheme part in the URL. // CURLUE_NO_USER (11) - There is no user part in the URL. // CURLUE_NO_PASSWORD (12) - There is no password part in the URL. // CURLUE_NO_OPTIONS (13) - There is no options part in the URL. // CURLUE_NO_HOST (14) - There is no host part in the URL. // CURLUE_NO_PORT (15) - There is no port part in the URL. // CURLUE_NO_QUERY (16) - There is no query part in the URL. // CURLUE_NO_FRAGMENT (17) - There is no fragment part in the URL. // CURLUE_NO_ZONEID (18) - There is no zone id set in the URL. // CURLUE_BAD_FILE_URL (19) - The file:// URL is invalid. // CURLUE_BAD_FRAGMENT (20) - The fragment part of the URL contained bad or invalid characters. // CURLUE_BAD_HOSTNAME (21) - The hostname contained bad or invalid characters. // CURLUE_BAD_IPV6 (22) - The IPv6 address hostname contained bad or invalid characters. // CURLUE_BAD_LOGIN (23) - The login part of the URL contained bad or invalid characters. // CURLUE_BAD_PASSWORD (24) - The password part of the URL contained bad or invalid characters. // CURLUE_BAD_PATH (25) - The path part of the URL contained bad or invalid characters. // CURLUE_BAD_QUERY (26) - The query part of the URL contained bad or invalid characters. // CURLUE_BAD_SCHEME (27) - The scheme part of the URL contained bad or invalid characters. // CURLUE_BAD_SLASHES (28) - The URL contained an invalid number of slashes. // CURLUE_BAD_USER (29) - The user part of the URL contained bad or invalid characters. // // Curlhcode // The header interface returns a CURLHcode to indicate when an error has occurred. // CURLHE_BADINDEX (1) - There is no header with the requested index. // CURLHE_MISSING (2) - No such header exists. // CURLHE_NOHEADERS (3) - No headers at all have been recorded. // CURLHE_NOREQUEST (4) - There was no such request number. // CURLHE_OUT_OF_MEMORY (5) - Out of resources // CURLHE_BAD_ARGUMENT (6) - One or more of the given arguments are bad. // CURLHE_NOT_BUILT_IN (7) - HTTP support or the header API has been disabled in the build. // // ===== LITERATURE_SOURCES // * CURL_SE (2023-09-22) // URL: https://curl.se/libcurl/c/libcurl-errors.html // LIBCURL_ERROR_CODES - END // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_CLOSE // ============================== PUBLIC // ============================== ABOUT // Close a cURL session. // ============================== SUPPORT // PHP_4 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_close() - PHP_4 >= PHP_4_0_2, PHP_5, PHP_7, PHP_8 // ============================== CODE function php_other_curl_curl_close($handle) { // ========== CURL_CLOSE - BEGIN // ===== ABOUT // Close a cURL session // ===== DESCRIPTION // Note: This function has no effect. Prior to PHP 8.0.0, this function was used to close the resource. // Closes a cURL session and frees all resources. The cURL handle, handle, is also deleted. // ===== SUPPORTED // PHP_4 >= PHP_4_0_2, PHP_5, PHP_7, PHP_8 // ===== SYNTAX // curl_close(CurlHandle $handle): void // ===== CODE curl_close( $handle // CurlHandle handle - A cURL handle returned by curl_init(). ); // Return Values // No value is returned. // // Changelog // Version - Description // 8.0.0 - handle expects a CurlHandle instance now; previously, a resource was expected. // // [examples] // Examples // [example] // Example #1 Initializing a new cURL session and fetching a web page // [php] // // create a new cURL resource // $ch = curl_init(); // // // set URL and other appropriate options // curl_setopt($ch, CURLOPT_URL, "http://www.example.com/"); // curl_setopt($ch, CURLOPT_HEADER, 0); // // // grab URL and pass it to the browser // curl_exec($ch); // // // close cURL resource, and free up system resources // curl_close($ch); // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-06) // URL: https://www.php.net/manual/en/function.curl-close.php // ========== CURL_CLOSE - END // SYNTAX: // void curl_close(CurlHandle $handle) // Return: void } // ============================== END // PHP_OTHER_CURL_CURL_CLOSE // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_COPY_HANDLE // ============================== OFFLINE // ============================== ABOUT // Copy a cURL handle along with all of its preferences. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_copy_handle() - PHP_5, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curl_copy_handle($handle) { $return_curl_copy_handle = false; // ========== CURL_COPY_HANDLE - BEGIN // ===== ABOUT // Copy a cURL handle along with all of its preferences // ===== DESCRIPTION // Copies a cURL handle keeping the same preferences. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // curl_copy_handle(CurlHandle $handle): CurlHandle|false // ===== CODE $return_curl_copy_handle = curl_copy_handle( $handle // CurlHandle handle - A cURL handle returned by curl_init(). ); // Return Values // Returns a new cURL handle, or false on failure. // // Changelog // Version - Description // 8.0.0 - handle expects a CurlHandle instance now; previously, a resource was expected. // 8.0.0 - On success, this function returns a CurlHandle instance now; previously, a resource was returned. // // [examples] // Examples // [example] // Example #1 Copying a cURL handle // [php] // // create a new cURL resource // $ch = curl_init(); // // // set URL and other appropriate options // curl_setopt($ch, CURLOPT_URL, 'http://www.example.com/'); // curl_setopt($ch, CURLOPT_HEADER, 0); // // // copy the handle // $ch2 = curl_copy_handle($ch); // // // grab URL (http://www.example.com/) and pass it to the browser // curl_exec($ch2); // // // close cURL resources, and free up system resources // curl_close($ch2); // curl_close($ch); // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-06) // URL: https://www.php.net/manual/en/function.curl-copy-handle.php // ========== CURL_COPY_HANDLE - END // SYNTAX: // CurlHandle|false curl_copy_handle(CurlHandle $handle) return $return_curl_copy_handle; // CurlHandle|false } */ // ============================== END // PHP_OTHER_CURL_CURL_COPY_HANDLE // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_ERRNO // ============================== PUBLIC // ============================== ABOUT // Return the last error number. // ============================== SUPPORT // PHP_4 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_errno() - PHP_4 >= PHP_4_0_3, PHP_5, PHP_7, PHP_8 // ============================== CODE function php_other_curl_curl_errno($handle) { $return_curl_errno = 0; // ========== CURL_ERRNO - BEGIN // ===== ABOUT // Return the last error number // ===== DESCRIPTION // Returns the error number for the last cURL operation. // ===== SUPPORTED // PHP_4 >= PHP_4_0_3, PHP_5, PHP_7, PHP_8 // ===== SYNTAX // curl_errno(CurlHandle $handle): int // ===== CODE $return_curl_errno = curl_errno( $handle // CurlHandle handle - A cURL handle returned by curl_init(). ); // Return Values // Returns the error number or 0 (zero) if no error occurred. // // Changelog // Version - Description // 8.0.0 - handle expects a CurlHandle instance now; previously, a resource was expected. // // [examples] // Examples // [example] // Example #1 curl_errno() example // [php] // // Create a curl handle to a non-existing location // $ch = curl_init('http://404.php.net/'); // // // Execute // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // curl_exec($ch); // // // Check if any error occurred // if(curl_errno($ch)) // { // echo 'Curl error: ' . curl_error($ch); // } // // // Close handle // curl_close($ch); // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-06) // URL: https://www.php.net/manual/en/function.curl-errno.php // ========== CURL_ERRNO - END // SYNTAX: // int curl_errno(CurlHandle $handle) return $return_curl_errno; // int } // ============================== END // PHP_OTHER_CURL_CURL_ERRNO // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_ERROR // ============================== PUBLIC // ============================== ABOUT // Return a string containing the last error for the current session. // ============================== SUPPORT // PHP_4 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_error() - PHP_4 >= PHP_4_0_3, PHP_5, PHP_7, PHP_8 // ============================== CODE function php_other_curl_curl_error($handle) { $return_curl_error = null; // ========== CURL_ERROR - BEGIN // ===== ABOUT // Return a string containing the last error for the current session // ===== DESCRIPTION // Returns a clear text error message for the last cURL operation. // ===== SUPPORTED // PHP_4 >= PHP_4_0_3, PHP_5, PHP_7, PHP_8 // ===== SYNTAX // curl_error(CurlHandle $handle): string // ===== CODE $return_curl_error = curl_error( $handle // CurlHandle handle - A cURL handle returned by curl_init(). ); // Return Values // Returns the error message or '' (the empty string) if no error occurred. // // Changelog // Version - Description // 8.0.0 - handle expects a CurlHandle instance now; previously, a resource was expected. // // [examples] // Examples // [example] // Example #1 curl_error() example // [php] // // Create a curl handle to a non-existing location // $ch = curl_init('http://404.php.net/'); // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // // if(curl_exec($ch) === false) // { // echo 'Curl error: ' . curl_error($ch); // } // else // { // echo 'Operation completed without any errors'; // } // // // Close handle // curl_close($ch); // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-06) // URL: https://www.php.net/manual/en/function.curl-error.php // ========== CURL_ERROR - END // SYNTAX: // string curl_error(CurlHandle $handle) return $return_curl_error; // string } // ============================== END // PHP_OTHER_CURL_CURL_ERROR // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_ESCAPE // ============================== OFFLINE // ============================== ABOUT // URL encodes the given string. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_escape() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curl_escape($handle, $string) { $return_curl_escape = false; // ========== CURL_ESCAPE - BEGIN // ===== ABOUT // URL encodes the given string // ===== DESCRIPTION // This function URL encodes the given string according to > RFC 3986. // ===== SUPPORTED // PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ===== SYNTAX // curl_escape(CurlHandle $handle, string $string): string|false // ===== CODE $return_curl_escape = curl_escape( $handle, // CurlHandle handle - A cURL handle returned by curl_init(). $string // string string - The string to be encoded. ); // Return Values // Returns escaped string or false on failure. // // Changelog // Version - Description // 8.0.0 - handle expects a CurlHandle instance now; previously, a resource was expected. // // [examples] // Examples // [example] // Example #1 curl_escape() example // [php] // // Create a curl handle // $ch = curl_init(); // // // Escape a string used as a GET parameter // $location = curl_escape($ch, 'Hofbräuhaus / München'); // // Result: Hofbr%C3%A4uhaus%20%2F%20M%C3%BCnchen // // // Compose an URL with the escaped string // $url = "http://example.com/add_location.php?location={$location}"; // // Result: http://example.com/add_location.php?location=Hofbr%C3%A4uhaus%20%2F%20M%C3%BCnchen // // // Send HTTP request and close the handle // curl_setopt($ch, CURLOPT_URL, $url); // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // curl_exec($ch); // curl_close($ch); // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-06) // URL: https://www.php.net/manual/en/function.curl-escape.php // ========== CURL_ESCAPE - END // SYNTAX: // string|false curl_escape(CurlHandle $handle, string $string) return $return_curl_escape; // string|false } */ // ============================== END // PHP_OTHER_CURL_CURL_ESCAPE // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_EXEC // ============================== PUBLIC // ============================== ABOUT // Perform a cURL session. // ============================== SUPPORT // PHP_4 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_exec() - PHP_4 >= PHP_4_0_2, PHP_5, PHP_7, PHP_8 // ============================== CODE function php_other_curl_curl_exec($handle) { $return_curl_exec = false; // ========== CURL_EXEC - BEGIN // ===== ABOUT // Perform a cURL session // ===== DESCRIPTION // Execute the given cURL session. // This function should be called after initializing a cURL session and all the options for the session are set. // ===== SUPPORTED // PHP_4 >= PHP_4_0_2, PHP_5, PHP_7, PHP_8 // ===== SYNTAX // curl_exec(CurlHandle $handle): string|bool // ===== CODE $return_curl_exec = curl_exec( $handle // CurlHandle handle - A cURL handle returned by curl_init(). ); // Return Values // Returns true on success or false on failure. However, if the CURLOPT_RETURNTRANSFER option is set, it will return the result on success, false on failure. // Warning: This function may return Boolean false, but may also return a non-Boolean value which evaluates to false. Please read the section on Booleans for more information. Use the === operator for testing the return value of this function. // Note: Note that response status codes which indicate errors (such as 404 Not found) are not regarded as failure. curl_getinfo() can be used to check for these. // // Changelog // Version - Description // 8.0.0 - handle expects a CurlHandle instance now; previously, a resource was expected. // // [examples] // Examples // [example] // Example #1 Fetching a web page // [php] // // create a new cURL resource // $ch = curl_init(); // // // set URL and other appropriate options // curl_setopt($ch, CURLOPT_URL, "http://www.example.com/"); // curl_setopt($ch, CURLOPT_HEADER, 0); // // // grab URL and pass it to the browser // curl_exec($ch); // // // close cURL resource, and free up system resources // curl_close($ch); // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-06) // URL: https://www.php.net/manual/en/function.curl-exec.php // ========== CURL_EXEC - END // SYNTAX: // string|bool curl_exec(CurlHandle $handle) return $return_curl_exec; // string|bool } // ============================== END // PHP_OTHER_CURL_CURL_EXEC // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_GETINFO // ============================== PUBLIC // ============================== ABOUT // Get information regarding a specific transfer. // ============================== SUPPORT // PHP_4 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_getinfo() - PHP_4 >= PHP_4_0_4, PHP_5, PHP_7, PHP_8 // ============================== CODE function php_other_curl_curl_getinfo($handle, $option = null) { $return_curl_getinfo = null; // ========== CURL_GETINFO - BEGIN // ===== ABOUT // Get information regarding a specific transfer // ===== DESCRIPTION // Gets information about the last transfer. // ===== SUPPORTED // PHP_4 >= PHP_4_0_4, PHP_5, PHP_7, PHP_8 // ===== SYNTAX // curl_getinfo(CurlHandle $handle, ?int $option = null): mixed // ===== CODE $return_curl_getinfo = curl_getinfo( $handle, // CurlHandle handle - A cURL handle returned by curl_init(). $option // int option - This may be one of the following constants: // * CURLINFO_EFFECTIVE_URL - Last effective URL // * CURLINFO_HTTP_CODE - The last response code. As of cURL 7.10.8, this is a legacy alias of CURLINFO_RESPONSE_CODE // * CURLINFO_FILETIME - Remote time of the retrieved document, with the CURLOPT_FILETIME enabled; if -1 is returned the time of the document is unknown // * CURLINFO_TOTAL_TIME - Total transaction time in seconds for last transfer // * CURLINFO_NAMELOOKUP_TIME - Time in seconds until name resolving was complete // * CURLINFO_CONNECT_TIME - Time in seconds it took to establish the connection // * CURLINFO_PRETRANSFER_TIME - Time in seconds from start until just before file transfer begins // * CURLINFO_STARTTRANSFER_TIME - Time in seconds until the first byte is about to be transferred // * CURLINFO_REDIRECT_COUNT - Number of redirects, with the CURLOPT_FOLLOWLOCATION option enabled // * CURLINFO_REDIRECT_TIME - Time in seconds of all redirection steps before final transaction was started, with the CURLOPT_FOLLOWLOCATION option enabled // * CURLINFO_REDIRECT_URL - With the CURLOPT_FOLLOWLOCATION option disabled: redirect URL found in the last transaction, that should be requested manually next. With the CURLOPT_FOLLOWLOCATION option enabled: this is empty. The redirect URL in this case is available in CURLINFO_EFFECTIVE_URL // * CURLINFO_PRIMARY_IP - IP address of the most recent connection // * CURLINFO_PRIMARY_PORT - Destination port of the most recent connection // * CURLINFO_LOCAL_IP - Local (source) IP address of the most recent connection // * CURLINFO_LOCAL_PORT - Local (source) port of the most recent connection // * CURLINFO_SIZE_UPLOAD - Total number of bytes uploaded // * CURLINFO_SIZE_DOWNLOAD - Total number of bytes downloaded // * CURLINFO_SPEED_DOWNLOAD - Average download speed // * CURLINFO_SPEED_UPLOAD - Average upload speed // * CURLINFO_HEADER_SIZE - Total size of all headers received // * CURLINFO_HEADER_OUT - The request string sent. For this to work, add the CURLINFO_HEADER_OUT option to the handle by calling curl_setopt() // * CURLINFO_REFERER - The referrer header // * CURLINFO_REQUEST_SIZE - Total size of issued requests, currently only for HTTP requests // * CURLINFO_RETRY_AFTER - The information from the Retry-After: header, or zero if there was no valid header. // * CURLINFO_SSL_VERIFYRESULT - Result of SSL certification verification requested by setting CURLOPT_SSL_VERIFYPEER // * CURLINFO_CONTENT_LENGTH_DOWNLOAD - Content length of download, read from Content-Length: field // * CURLINFO_CONTENT_LENGTH_UPLOAD - Specified size of upload // * CURLINFO_CONTENT_TYPE - Content-Type: of the requested document. NULL indicates server did not send valid Content-Type: header // * CURLINFO_PRIVATE - Private data associated with this cURL handle, previously set with the CURLOPT_PRIVATE option of curl_setopt() // * CURLINFO_PROXY_ERROR - The detailed (SOCKS) proxy error code when the most recent transfer returned a CURLE_PROXY error. The returned value will be exactly one of the CURLPX_* values. The error code will be CURLPX_OK if no response code was available. // * CURLINFO_RESPONSE_CODE - The last response code // * CURLINFO_HTTP_CONNECTCODE - The CONNECT response code // * CURLINFO_HTTPAUTH_AVAIL - Bitmask indicating the authentication method(s) available according to the previous response // * CURLINFO_PROXYAUTH_AVAIL - Bitmask indicating the proxy authentication method(s) available according to the previous response // * CURLINFO_OS_ERRNO - Errno from a connect failure. The number is OS and system specific. // * CURLINFO_NUM_CONNECTS - Number of connections curl had to create to achieve the previous transfer // * CURLINFO_SSL_ENGINES - OpenSSL crypto-engines supported // * CURLINFO_COOKIELIST - All known cookies // * CURLINFO_FTP_ENTRY_PATH - Entry path in FTP server // * CURLINFO_APPCONNECT_TIME - Time in seconds it took from the start until the SSL/SSH connect/handshake to the remote host was completed // * CURLINFO_CERTINFO - TLS certificate chain // * CURLINFO_CONDITION_UNMET - Info on unmet time conditional // * CURLINFO_RTSP_CLIENT_CSEQ - Next RTSP client CSeq // * CURLINFO_RTSP_CSEQ_RECV - Recently received CSeq // * CURLINFO_RTSP_SERVER_CSEQ - Next RTSP server CSeq // * CURLINFO_RTSP_SESSION_ID - RTSP session ID // * CURLINFO_CONTENT_LENGTH_DOWNLOAD_T - The content-length of the download. This is the value read from the Content-Length: field. -1 if the size isn't known // * CURLINFO_CONTENT_LENGTH_UPLOAD_T - The specified size of the upload. -1 if the size isn't known // * CURLINFO_HTTP_VERSION - The version used in the last HTTP connection. The return value will be one of the defined CURL_HTTP_VERSION_* constants or 0 if the version can't be determined // * CURLINFO_PROTOCOL - The protocol used in the last HTTP connection. The returned value will be exactly one of the CURLPROTO_* values // * CURLINFO_PROXY_SSL_VERIFYRESULT - The result of the certificate verification that was requested (using the CURLOPT_PROXY_SSL_VERIFYPEER option). Only used for HTTPS proxies // * CURLINFO_SCHEME - The URL scheme used for the most recent connection // * CURLINFO_SIZE_DOWNLOAD_T - Total number of bytes that were downloaded. The number is only for the latest transfer and will be reset again for each new transfer // * CURLINFO_SIZE_UPLOAD_T - Total number of bytes that were uploaded // * CURLINFO_SPEED_DOWNLOAD_T - The average download speed in bytes/second that curl measured for the complete download // * CURLINFO_SPEED_UPLOAD_T - The average upload speed in bytes/second that curl measured for the complete upload // * CURLINFO_APPCONNECT_TIME_T - Time, in microseconds, it took from the start until the SSL/SSH connect/handshake to the remote host was completed // * CURLINFO_CONNECT_TIME_T - Total time taken, in microseconds, from the start until the connection to the remote host (or proxy) was completed // * CURLINFO_FILETIME_T - Remote time of the retrieved document (as Unix timestamp), an alternative to CURLINFO_FILETIME to allow systems with 32 bit long variables to extract dates outside of the 32bit timestamp range // * CURLINFO_NAMELOOKUP_TIME_T - Time in microseconds from the start until the name resolving was completed // * CURLINFO_PRETRANSFER_TIME_T - Time taken from the start until the file transfer is just about to begin, in microseconds // * CURLINFO_REDIRECT_TIME_T - Total time, in microseconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before final transaction was started // * CURLINFO_STARTTRANSFER_TIME_T - Time, in microseconds, it took from the start until the first byte is received // * CURLINFO_TOTAL_TIME_T - Total time in microseconds for the previous transfer, including name resolving, TCP connect etc. ); // Return Values // If option is given, returns its value. Otherwise, returns an associative array with the following elements (which correspond to option), or false on failure: // * "url" // * "content_type" // * "http_code" // * "header_size" // * "request_size" // * "filetime" // * "ssl_verify_result" // * "redirect_count" // * "total_time" // * "namelookup_time" // * "connect_time" // * "pretransfer_time" // * "size_upload" // * "size_download" // * "speed_download" // * "speed_upload" // * "download_content_length" // * "upload_content_length" // * "starttransfer_time" // * "redirect_time" // * "certinfo" // * "primary_ip" // * "primary_port" // * "local_ip" // * "local_port" // * "redirect_url" // * "request_header" (This is only set if the CURLINFO_HEADER_OUT is set by a previous call to curl_setopt()) // Note that private data is not included in the associative array and must be retrieved individually with the CURLINFO_PRIVATE option. // // Changelog // Version - Description // 8.2.0 - Introduced CURLINFO_PROXY_ERROR, CURLINFO_REFERER, CURLINFO_RETRY_AFTER. // 8.0.0 - handle expects a CurlHandle instance now; previously, a resource was expected. // 8.0.0 - option is nullable now; previously, the default was 0. // 7.3.0 - Introduced CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, CURLINFO_CONTENT_LENGTH_UPLOAD_T, CURLINFO_HTTP_VERSION, CURLINFO_PROTOCOL, CURLINFO_PROXY_SSL_VERIFYRESULT, CURLINFO_SCHEME, CURLINFO_SIZE_DOWNLOAD_T, CURLINFO_SIZE_UPLOAD_T, CURLINFO_SPEED_DOWNLOAD_T, CURLINFO_SPEED_UPLOAD_T, CURLINFO_APPCONNECT_TIME_T, CURLINFO_CONNECT_TIME_T, CURLINFO_FILETIME_T, CURLINFO_NAMELOOKUP_TIME_T, CURLINFO_PRETRANSFER_TIME_T, CURLINFO_REDIRECT_TIME_T, CURLINFO_STARTTRANSFER_TIME_T, CURLINFO_TOTAL_TIME_T. // // [examples] // Examples // [example] // Example #1 curl_getinfo() example // [php] // // Create a cURL handle // $ch = curl_init('http://www.example.com/'); // // // Execute // curl_exec($ch); // // // Check if any error occurred // if (!curl_errno($ch)) { // $info = curl_getinfo($ch); // echo 'Took ', $info['total_time'], ' seconds to send a request to ', $info['url'], "\n"; // } // // // Close handle // curl_close($ch); // [/php] // [/example] // [example] // Example #2 curl_getinfo() example with option parameter // [php] // // Create a cURL handle // $ch = curl_init('http://www.example.com/'); // // // Execute // curl_exec($ch); // // // Check HTTP status code // if (!curl_errno($ch)) { // switch ($http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE)) { // case 200: # OK // break; // default: // echo 'Unexpected HTTP code: ', $http_code, "\n"; // } // } // // // Close handle // curl_close($ch); // [/php] // [/example] // [/examples] // // Notes // Note: Information gathered by this function is kept if the handle is re-used. This means that unless a statistic is overridden internally by this function, the previous info is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-06) // URL: https://www.php.net/manual/en/function.curl-getinfo.php // ========== CURL_GETINFO - END // SYNTAX: // mixed curl_getinfo(CurlHandle $handle, int $option = null) return $return_curl_getinfo; // mixed } // ============================== END // PHP_OTHER_CURL_CURL_GETINFO // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_INIT // ============================== PUBLIC // ============================== ABOUT // Initialize a cURL session. // ============================== SUPPORT // PHP_4 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_init() - PHP_4 >= PHP_4_0_2, PHP_5, PHP_7, PHP_8 // ============================== CODE function php_other_curl_curl_init($url = null) { $return_curl_init = false; // ========== CURL_INIT - BEGIN // ===== ABOUT // Initialize a cURL session // ===== DESCRIPTION // Initializes a new session and return a cURL handle for use with the curl_setopt(), curl_exec(), and curl_close() functions. // ===== SUPPORTED // PHP_4 >= PHP_4_0_2, PHP_5, PHP_7, PHP_8 // ===== SYNTAX // curl_init(?string $url = null): CurlHandle|false // ===== CODE $return_curl_init = curl_init( $url // string url - If provided, the CURLOPT_URL option will be set to its value. You can manually set this using the curl_setopt() function. // Note: The file protocol is disabled by cURL if open_basedir is set. ); // Return Values // Returns a cURL handle on success, false on errors. // // Changelog // Version - Description // 8.0.0 - On success, this function returns a CurlHandle instance now; previously, a resource was returned. // 8.0.0 - url is nullable now. // // [examples] // Examples // [example] // Example #1 Initializing a new cURL session and fetching a web page // [php] // // create a new cURL resource // $ch = curl_init(); // // // set URL and other appropriate options // curl_setopt($ch, CURLOPT_URL, "http://www.example.com/"); // curl_setopt($ch, CURLOPT_HEADER, 0); // // // grab URL and pass it to the browser // curl_exec($ch); // // // close cURL resource, and free up system resources // curl_close($ch); // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-06) // URL: https://www.php.net/manual/en/function.curl-init.php // ========== CURL_INIT - END // SYNTAX: // CurlHandle|false curl_init(string $url = null) return $return_curl_init; // CurlHandle|false } // ============================== END // PHP_OTHER_CURL_CURL_INIT // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_MULTI_ADD_HANDLE // ============================== OFFLINE // ============================== ABOUT // Add a normal cURL handle to a cURL multi handle. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_multi_add_handle() - PHP_5, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curl_multi_add_handle($multi_handle, $handle) { $return_curl_multi_add_handle = 0; // ========== CURL_MULTI_ADD_HANDLE - BEGIN // ===== ABOUT // Add a normal cURL handle to a cURL multi handle // ===== DESCRIPTION // Adds the handle handle to the multi handle multi_handle // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // curl_multi_add_handle(CurlMultiHandle $multi_handle, CurlHandle $handle): int // ===== CODE $return_curl_multi_add_handle = curl_multi_add_handle( $multi_handle, // CurlMultiHandle multi_handle - A cURL multi handle returned by curl_multi_init(). $handle // CurlHandle handle - A cURL handle returned by curl_init(). ); // Return Values // Returns 0 on success, or one of the CURLM_XXX errors code. // // Changelog // Version - Description // 8.0.0 - multi_handle expects a CurlMultiHandle instance now; previously, a resource was expected. // 8.0.0 - handle expects a CurlHandle instance now; previously, a resource was expected. // // [examples] // Examples // [example] // Example #1 curl_multi_add_handle() example // This example will create two cURL handles, add them to a multi handle, and process them asynchronously. // [php] // // create both cURL resources // $ch1 = curl_init(); // $ch2 = curl_init(); // // // set URL and other appropriate options // curl_setopt($ch1, CURLOPT_URL, "http://www.example.com/"); // curl_setopt($ch1, CURLOPT_HEADER, 0); // curl_setopt($ch2, CURLOPT_URL, "http://www.php.net/"); // curl_setopt($ch2, CURLOPT_HEADER, 0); // // //create the multiple cURL handle // $mh = curl_multi_init(); // // //add the two handles // curl_multi_add_handle($mh,$ch1); // curl_multi_add_handle($mh,$ch2); // // //execute the multi handle // do { // $status = curl_multi_exec($mh, $active); // if ($active) { // curl_multi_select($mh); // } // } while ($active && $status == CURLM_OK); // // //close all the handles // curl_multi_remove_handle($mh, $ch1); // curl_multi_remove_handle($mh, $ch2); // curl_multi_close($mh); // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-06) // URL: https://www.php.net/manual/en/function.curl-multi-add-handle.php // ========== CURL_MULTI_ADD_HANDLE - END // SYNTAX: // int curl_multi_add_handle(CurlMultiHandle $multi_handle, CurlHandle $handle) return $return_curl_multi_add_handle; // int } */ // ============================== END // PHP_OTHER_CURL_CURL_MULTI_ADD_HANDLE // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_MULTI_CLOSE // ============================== OFFLINE // ============================== ABOUT // Close a set of cURL handles. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_multi_close() - PHP_5, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curl_multi_close($multi_handle) { // ========== CURL_MULTI_CLOSE - BEGIN // ===== ABOUT // Close a set of cURL handles // ===== DESCRIPTION // Note: This function has no effect. Prior to PHP 8.0.0, this function was used to close the resource. // Closes a set of cURL handles. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // curl_multi_close(CurlMultiHandle $multi_handle): void // ===== CODE curl_multi_close( $multi_handle // CurlMultiHandle $multi_handle - A cURL multi handle returned by curl_multi_init(). ); // Return Values // No value is returned. // // Changelog // Version - Description // 8.0.0 - multi_handle expects a CurlMultiHandle instance now; previously, a resource was expected. // // [examples] // Examples // [example] // Example #1 curl_multi_close() example // This example will create two cURL handles, add them to a multi handle, and process them asynchronously. // [php] // // create both cURL resources // $ch1 = curl_init(); // $ch2 = curl_init(); // // // set URL and other appropriate options // curl_setopt($ch1, CURLOPT_URL, "http://www.example.com/"); // curl_setopt($ch1, CURLOPT_HEADER, 0); // curl_setopt($ch2, CURLOPT_URL, "http://www.php.net/"); // curl_setopt($ch2, CURLOPT_HEADER, 0); // // //create the multiple cURL handle // $mh = curl_multi_init(); // // //add the two handles // curl_multi_add_handle($mh,$ch1); // curl_multi_add_handle($mh,$ch2); // // //execute the multi handle // do { // $status = curl_multi_exec($mh, $active); // if ($active) { // curl_multi_select($mh); // } // } while ($active && $status == CURLM_OK); // // //close the handles // curl_multi_remove_handle($mh, $ch1); // curl_close($ch1); // curl_multi_remove_handle($mh, $ch2); // curl_close($ch2); // curl_multi_close($mh); // // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-06) // URL: https://www.php.net/manual/en/function.curl-multi-close.php // ========== CURL_MULTI_CLOSE - END // SYNTAX: // void curl_multi_close(CurlMultiHandle $multi_handle) // Return: void } */ // ============================== END // PHP_OTHER_CURL_CURL_MULTI_CLOSE // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_MULTI_ERRNO // ============================== OFFLINE // ============================== ABOUT // Return the last multi curl error number. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_multi_errno() - PHP_7 >= PHP_7_1_0, PHP_8 // ============================== CODE /* function php_other_curl_curl_multi_errno($multi_handle) { $return_curl_multi_errno = 0; // ========== CURL_MULTI_ERRNO - BEGIN // ===== ABOUT // Return the last multi curl error number // ===== DESCRIPTION // Return an integer containing the last multi curl error number. // ===== SUPPORTED // PHP_7 >= PHP_7_1_0, PHP_8 // ===== SYNTAX // curl_multi_errno(CurlMultiHandle $multi_handle): int // ===== CODE $return_curl_multi_errno = curl_multi_errno( $multi_handle // CurlMultiHandle multi_handle - A cURL multi handle returned by curl_multi_init(). ); // Return Values // Return an integer containing the last multi curl error number. // // Changelog // Version - Description // 8.0.0 - The function no longer returns false on failure. // 8.0.0 - multi_handle expects a CurlMultiHandle instance now; previously, a resource was expected. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-06) // URL: https://www.php.net/manual/en/function.curl-multi-errno.php // ========== CURL_MULTI_ERRNO - END // SYNTAX: // int curl_multi_errno(CurlMultiHandle $multi_handle) return $return_curl_multi_errno; // int } */ // ============================== END // PHP_OTHER_CURL_CURL_MULTI_ERRNO // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_MULTI_EXEC // ============================== OFFLINE // ============================== ABOUT // Run the sub-connections of the current cURL handle. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_multi_exec() - PHP_5, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curl_multi_exec($multi_handle, & $still_running) { $return_curl_multi_exec = 0; // ========== CURL_MULTI_EXEC - BEGIN // ===== ABOUT // Run the sub-connections of the current cURL handle // ===== DESCRIPTION // Processes each of the handles in the stack. This method can be called whether or not a handle needs to read or write data. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // curl_multi_exec(CurlMultiHandle $multi_handle, int &$still_running): int // ===== CODE $return_curl_multi_exec = curl_multi_exec( $multi_handle, // CurlMultiHandle multi_handle - A cURL multi handle returned by curl_multi_init(). $still_running // int& still_running - A reference to a flag to tell whether the operations are still running. ); // Return Values // A cURL code defined in the cURL Predefined Constants. // Note: This only returns errors regarding the whole multi stack. There might still have occurred problems on individual transfers even when this function returns CURLM_OK. // // Changelog // Version - Description // 8.0.0 - multi_handle expects a CurlMultiHandle instance now; previously, a resource was expected. // // [examples] // Examples // [example] // Example #1 curl_multi_exec() example // This example will create two cURL handles, add them to a multi handle, and process them asynchronously. // [php] // // create both cURL resources // $ch1 = curl_init(); // $ch2 = curl_init(); // // // set URL and other appropriate options // curl_setopt($ch1, CURLOPT_URL, "http://example.com/"); // curl_setopt($ch1, CURLOPT_HEADER, 0); // curl_setopt($ch2, CURLOPT_URL, "http://www.php.net/"); // curl_setopt($ch2, CURLOPT_HEADER, 0); // // //create the multiple cURL handle // $mh = curl_multi_init(); // // //add the two handles // curl_multi_add_handle($mh,$ch1); // curl_multi_add_handle($mh,$ch2); // // //execute the multi handle // do { // $status = curl_multi_exec($mh, $active); // if ($active) { // // Wait a short time for more activity // curl_multi_select($mh); // } // } while ($active && $status == CURLM_OK); // // //close the handles // curl_multi_remove_handle($mh, $ch1); // curl_multi_remove_handle($mh, $ch2); // curl_multi_close($mh); // // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-06) // URL: https://www.php.net/manual/en/function.curl-multi-exec.php // ========== CURL_MULTI_EXEC - END // SYNTAX: // int curl_multi_exec(CurlMultiHandle $multi_handle, int& $still_running) return $return_curl_multi_exec; // int } */ // ============================== END // PHP_OTHER_CURL_CURL_MULTI_EXEC // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_MULTI_GETCONTENT // ============================== OFFLINE // ============================== ABOUT // Return the content of a cURL handle if CURLOPT_RETURNTRANSFER is set. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_multi_getcontent() - PHP_5, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curl_multi_getcontent($handle) { $return_curl_multi_getcontent = null; // ========== CURL_MULTI_GETCONTENT - BEGIN // ===== ABOUT // Return the content of a cURL handle if CURLOPT_RETURNTRANSFER is set // ===== DESCRIPTION // 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. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // curl_multi_getcontent(CurlHandle $handle): ?string // ===== CODE $return_curl_multi_getcontent = curl_multi_getcontent( $handle // CurlHandle handle - A cURL handle returned by curl_init(). ); // Return Values // Return the content of a cURL handle if CURLOPT_RETURNTRANSFER is set or null if not set. // // Changelog // Version - Description // 8.0.0 - handle expects a CurlHandle instance now; previously, a resource was expected. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-06) // URL: https://www.php.net/manual/en/function.curl-multi-getcontent.php // ========== CURL_MULTI_GETCONTENT - END // SYNTAX: // string curl_multi_getcontent(CurlHandle $handle) return $return_curl_multi_getcontent; // string } */ // ============================== END // PHP_OTHER_CURL_CURL_MULTI_GETCONTENT // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_MULTI_INFO_READ // ============================== OFFLINE // ============================== ABOUT // Get information about the current transfers. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_multi_info_read() - PHP_5, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curl_multi_info_read($multi_handle, & $queued_messages) { $return_curl_multi_info_read = false; // ========== CURL_MULTI_INFO_READ - BEGIN // ===== ABOUT // Get information about the current transfers // ===== DESCRIPTION // Ask the multi handle if there are any messages or information from the individual transfers. Messages may include information such as an error code from the transfer or just the fact that a transfer is completed. // Repeated calls to this function will return a new result each time, until a false is returned as a signal that there is no more to get at this point. The integer pointed to with queued_messages will contain the number of remaining messages after this function was called. // Warning: The data the returned resource points to will not survive calling curl_multi_remove_handle(). // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // curl_multi_info_read(CurlMultiHandle $multi_handle, int &$queued_messages = null): array|false // ===== CODE $return_curl_multi_info_read = curl_multi_info_read( $multi_handle, // CurlMultiHandle multi_handle - A cURL multi handle returned by curl_multi_init(). $queued_messages // int& queued_messages - Number of messages that are still in the queue ); // Return Values // On success, returns an associative array for the message, false on failure. // Contents of the returned array // Key: - Value: // msg - The CURLMSG_DONE constant. Other return values are currently not available. // result - One of the CURLE_* constants. If everything is OK, the CURLE_OK will be the result. // handle - Resource of type curl indicates the handle which it concerns. // // Changelog // Version - Description // 8.0.0 - multi_handle expects a CurlMultiHandle instance now; previously, a resource was expected. // // [examples] // Examples // [example] // Example #1 A curl_multi_info_read() example // [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); // if ($active) { // curl_multi_select($mh); // } // while (false !== ($info = curl_multi_info_read($mh))) { // var_dump($info); // } // } while ($active && $status == CURLM_OK); // // foreach ($urls as $i => $url) { // $res[$i] = curl_multi_getcontent($conn[$i]); // curl_close($conn[$i]); // } // // var_dump(curl_multi_info_read($mh)); // // [/php] // The above example will output something similar to: // [result] // 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) // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-06) // URL: https://www.php.net/manual/en/function.curl-multi-info-read.php // ========== CURL_MULTI_INFO_READ - END // SYNTAX: // array|false curl_multi_info_read(CurlMultiHandle $multi_handle, int& $queued_messages) return $return_curl_multi_info_read; // array|false } */ // ============================== END // PHP_OTHER_CURL_CURL_MULTI_INFO_READ // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_MULTI_INIT // ============================== OFFLINE // ============================== ABOUT // Returns a new cURL multi handle. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_multi_init() - PHP_5, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curl_multi_init() { $return_curl_multi_init = null; // ========== CURL_MULTI_INIT - BEGIN // ===== ABOUT // Returns a new cURL multi handle // ===== DESCRIPTION // Allows the processing of multiple cURL handles asynchronously. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // curl_multi_init(): CurlMultiHandle // ===== CODE $return_curl_multi_init = curl_multi_init( // This function has no parameters. ); // Return Values // Returns a cURL multi handle. // // Changelog // Version - Description // 8.0.0 - On success, this function returns a CurlMultiHandle instance now; previously, a resource was returned. // // [examples] // Examples // [example] // Example #1 curl_multi_init() example // This example will create two cURL handles, add them to a multi handle, and process them asynchronously. // [php] // // create both cURL resources // $ch1 = curl_init(); // $ch2 = curl_init(); // // // set URL and other appropriate options // curl_setopt($ch1, CURLOPT_URL, "http://lxr.php.net/"); // curl_setopt($ch1, CURLOPT_HEADER, 0); // curl_setopt($ch2, CURLOPT_URL, "http://www.php.net/"); // curl_setopt($ch2, CURLOPT_HEADER, 0); // // //create the multiple cURL handle // $mh = curl_multi_init(); // // //add the two handles // curl_multi_add_handle($mh,$ch1); // curl_multi_add_handle($mh,$ch2); // // //execute the multi handle // do { // $status = curl_multi_exec($mh, $active); // if ($active) { // curl_multi_select($mh); // } // } while ($active && $status == CURLM_OK); // // //close the handles // curl_multi_remove_handle($mh, $ch1); // curl_multi_remove_handle($mh, $ch2); // curl_multi_close($mh); // // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-07) // URL: https://www.php.net/manual/en/function.curl-multi-init.php // ========== CURL_MULTI_INIT - END // SYNTAX: // CurlMultiHandle curl_multi_init() return $return_curl_multi_init; // CurlMultiHandle } */ // ============================== END // PHP_OTHER_CURL_CURL_MULTI_INIT // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_MULTI_REMOVE_HANDLE // ============================== OFFLINE // ============================== ABOUT // Remove a multi handle from a set of cURL handles. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_multi_remove_handle() - PHP_5, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curl_multi_remove_handle($multi_handle, $handle) { $return_curl_multi_remove_handle = 0; // ========== CURL_MULTI_REMOVE_HANDLE - BEGIN // ===== ABOUT // Remove a multi handle from a set of cURL handles // ===== DESCRIPTION // Removes a given handle handle from the given multi_handle handle. When the handle handle has been removed, it is again perfectly legal to run curl_exec() on this handle. Removing the handle handle while being used, will effectively halt the transfer in progress involving that handle. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // curl_multi_remove_handle(CurlMultiHandle $multi_handle, CurlHandle $handle): int // ===== CODE $return_curl_multi_remove_handle = curl_multi_remove_handle( $multi_handle, // CurlMultiHandle multi_handle - A cURL multi handle returned by curl_multi_init(). $handle // CurlHandle handle - A cURL handle returned by curl_init(). ); // Return Values // Returns 0 on success, or one of the CURLM_XXX error codes. // // Changelog // Version - Description // 8.0.0 - multi_handle expects a CurlMultiHandle instance now; previously, a resource was expected. // 8.0.0 - handle expects a CurlHandle instance now; previously, a resource was expected. // ===== LITERATURE_SOURCES // * PHP_NET (2023-09-22) // URL: https://www.php.net/manual/en/function.curl-multi-remove-handle.php // ========== CURL_MULTI_REMOVE_HANDLE - END // SYNTAX: // int curl_multi_remove_handle(CurlMultiHandle $multi_handle, CurlHandle $handle) return $return_curl_multi_remove_handle; // int } */ // ============================== END // PHP_OTHER_CURL_CURL_MULTI_REMOVE_HANDLE // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_MULTI_SELECT // ============================== OFFLINE // ============================== ABOUT // Wait for activity on any curl_multi connection. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_multi_select() - PHP_5, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curl_multi_select($multi_handle, $timeout = 1.0) { $return_curl_multi_select = 0; // ========== CURL_MULTI_SELECT - BEGIN // ===== ABOUT // Wait for activity on any curl_multi connection // ===== DESCRIPTION // Blocks until there is activity on any of the curl_multi connections. // ===== SUPPORTED // PHP_5, PHP_7, PHP_8 // ===== SYNTAX // curl_multi_select(CurlMultiHandle $multi_handle, float $timeout = 1.0): int // ===== CODE $return_curl_multi_select = curl_multi_select( $multi_handle, // CurlMultiHandle multi_handle - A cURL multi handle returned by curl_multi_init(). $timeout // float timeout - Time, in seconds, to wait for a response. ); // Return Values // On success, returns the number of descriptors contained in the descriptor sets. This may be 0 if there was no activity on any of the descriptors. On failure, this function will return -1 on a select failure (from the underlying select system call). // // Changelog // Version - Description // 8.0.0 - multi_handle expects a CurlMultiHandle instance now; previously, a resource was expected. // ===== LITERATURE_SOURCES // * PHP_NET (2023-09-22) // URL: https://www.php.net/manual/en/function.curl-multi-select.php // ========== CURL_MULTI_SELECT - END // SYNTAX: // int curl_multi_select(CurlMultiHandle $multi_handle, float $timeout = 1.0) return $return_curl_multi_select; // int } */ // ============================== END // PHP_OTHER_CURL_CURL_MULTI_SELECT // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_MULTI_SETOPT // ============================== OFFLINE // ============================== ABOUT // Set a cURL multi option. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_multi_setopt() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curl_multi_setopt($multi_handle, $option, $value) { $return_curl_multi_setopt = false; // ========== CURL_MULTI_SETOPT - BEGIN // ===== ABOUT // Set a cURL multi option // ===== DESCRIPTION // Sets an option on the given cURL multi handle. // ===== SUPPORTED // PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ===== SYNTAX // curl_multi_setopt(CurlMultiHandle $multi_handle, int $option, mixed $value): bool // ===== CODE $return_curl_multi_setopt = curl_multi_setopt( $multi_handle, // CurlMultiHandle multi_handle - A cURL multi handle returned by curl_multi_init(). $option, // int option - One of the CURLMOPT_* constants. $value // mixed value - The value to be set on option. // // value should be an int for the following values of the option parameter: // Option - Set value to // CURLMOPT_PIPELINING - Pass 1 to enable or 0 to disable. Enabling pipelining on a multi handle will make it attempt to perform HTTP Pipelining as far as possible for transfers using this handle. This means that if you add a second request that can use an already existing connection, the second request will be "piped" on the same connection. As of cURL 7.43.0, the value is a bitmask, and you can also pass 2 to try to multiplex the new transfer over an existing HTTP/2 connection if possible. Passing 3 instructs cURL to ask for pipelining and multiplexing independently of each other. As of cURL 7.62.0, setting the pipelining bit has no effect. Instead of integer literals, you can also use the CURLPIPE_* constants if available. // CURLMOPT_MAXCONNECTS - Pass a number that will be used as the maximum amount of simultaneously open connections that libcurl may cache. By default the size will be enlarged to fit four times the number of handles added via curl_multi_add_handle(). When the cache is full, curl closes the oldest one in the cache to prevent the number of open connections from increasing. // CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE - Pass a number that specifies the chunk length threshold for pipelining in bytes. // CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE - Pass a number that specifies the size threshold for pipelining penalty in bytes. // CURLMOPT_MAX_CONCURRENT_STREAMS - The set number will be used as the maximum number of concurrent streams for a connections that cURL should support on connections done using HTTP/2. Valid values range from 1 to 2147483647 (2^31 - 1). The value passed here would be honored based on other system resources properties. Default is 100. // CURLMOPT_MAX_HOST_CONNECTIONS - Pass a number that specifies the maximum number of connections to a single host. // CURLMOPT_MAX_PIPELINE_LENGTH - Pass a number that specifies the maximum number of requests in a pipeline. // CURLMOPT_MAX_TOTAL_CONNECTIONS - Pass a number that specifies the maximum number of simultaneously open connections. // CURLMOPT_PUSHFUNCTION - Pass a callable that will be registered to handle server pushes and should have the following signature: // pushfunction(resource $parent_ch, resource $pushed_ch, array $headers): int // resource parent_ch - The parent cURL handle (the request the client made). // resource pushed_ch - A new cURL handle for the pushed request. // array headers - The push promise headers. // The push function is supposed to return either CURL_PUSH_OK if it can handle the push, or CURL_PUSH_DENY to reject it. ); // Return Values // Returns true on success or false on failure. // // Changelog // Version - Description // 8.2.0 - Introduced CURLMOPT_MAX_CONCURRENT_STREAMS. // 8.0.0 - multi_handle expects a CurlMultiHandle instance now; previously, a resource was expected. // 7.1.0 - Introduced CURLMOPT_PUSHFUNCTION. // 7.0.7 - Introduced CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE, CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE, CURLMOPT_MAX_HOST_CONNECTIONS, CURLMOPT_MAX_PIPELINE_LENGTH and CURLMOPT_MAX_TOTAL_CONNECTIONS. // ===== LITERATURE_SOURCES // * PHP_NET (2023-09-22) // URL: https://www.php.net/manual/en/function.curl-multi-setopt.php // ========== CURL_MULTI_SETOPT - END // SYNTAX: // bool curl_multi_setopt(CurlMultiHandle $multi_handle, int $option, mixed $value) return $return_curl_multi_setopt; // bool } */ // ============================== END // PHP_OTHER_CURL_CURL_MULTI_SETOPT // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_MULTI_STRERROR // ============================== OFFLINE // ============================== ABOUT // Return string describing error code. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_multi_strerror() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curl_multi_strerror($error_code) { $return_curl_multi_strerror = null; // ========== CURL_MULTI_STRERROR - BEGIN // ===== ABOUT // Return string describing error code // ===== DESCRIPTION // Returns a text error message describing the given CURLM error code. // ===== SUPPORTED // PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ===== SYNTAX // curl_multi_strerror(int $error_code): ?string // ===== CODE $return_curl_multi_strerror = curl_multi_strerror( $error_code // int error_code - One of the > CURLM error codes constants. ); // Return Values // Returns error string for valid error code, null otherwise. // // [examples] // Examples // [example] // Example #1 curl_multi_strerror() example // [php] // // Create cURL handles // $ch1 = curl_init("http://example.com/"); // $ch2 = curl_init("http://php.net/"); // // // Create a cURL multi handle // $mh = curl_multi_init(); // // // Add the handles to the multi handle // curl_multi_add_handle($mh, $ch1); // curl_multi_add_handle($mh, $ch2); // // // Execute the multi handle // do { // $status = curl_multi_exec($mh, $active); // if ($active) { // curl_multi_select($mh); // } // } while ($active && $status === CURLM_OK); // // // Check for errors // if ($status != CURLM_OK) { // // Display error message // echo "ERROR!\n " . curl_multi_strerror($status); // } // // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-07) // URL: https://www.php.net/manual/en/function.curl-multi-strerror.php // ========== CURL_MULTI_STRERROR - END // SYNTAX: // string curl_multi_strerror(int $error_code) return $return_curl_multi_strerror; // string } */ // ============================== END // PHP_OTHER_CURL_CURL_MULTI_STRERROR // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_PAUSE // ============================== OFFLINE // ============================== ABOUT // Pause and unpause a connection. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_pause() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curl_pause($handle, $flags) { $return_curl_pause = 0; // ========== CURL_PAUSE - BEGIN // ===== ABOUT // Pause and unpause a connection // ===== DESCRIPTION // Pause or unpause a cURL session. A session can be paused while a transfer is in progress, in either the read, write or both directions, by calling this function from a callback registered with curl_setopt(). // ===== SUPPORTED // PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ===== SYNTAX // curl_pause(CurlHandle $handle, int $flags): int // ===== CODE $return_curl_pause = curl_pause( $handle, // CurlHandle handle - A cURL handle returned by curl_init(). $flags // int flags - One of CURLPAUSE_* constants. ); // Return Values // Returns an error code (CURLE_OK for no error). // // Changelog // Version - Description // 8.0.0 - handle expects a CurlHandle instance now; previously, a resource was expected. // ===== LITERATURE_SOURCES // * PHP_NET (2023-09-22) // URL: https://www.php.net/manual/en/function.curl-pause.php // ========== CURL_PAUSE - END // SYNTAX: // int curl_pause(CurlHandle $handle, int $flags) return $return_curl_pause; // int } */ // ============================== END // PHP_OTHER_CURL_CURL_PAUSE // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_RESET // ============================== OFFLINE // ============================== ABOUT // Reset all options of a libcurl session handle. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_reset() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curl_reset($handle) { // ========== CURL_RESET - BEGIN // ===== ABOUT // Reset all options of a libcurl session handle // ===== DESCRIPTION // This function re-initializes all options set on the given cURL handle to the default values. // ===== SUPPORTED // PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ===== SYNTAX // curl_reset(CurlHandle $handle): void // ===== CODE curl_reset( $handle // CurlHandle handle - A cURL handle returned by curl_init(). ); // Return Values // No value is returned. // // Changelog // Version - Description // 8.0.0 - handle expects a CurlHandle instance now; previously, a resource was expected. // // [examples] // Examples // [example] // Example #1 curl_reset() example // [php] // // Create a curl handle // $ch = curl_init(); // // // Set CURLOPT_USERAGENT option // curl_setopt($ch, CURLOPT_USERAGENT, "My test user-agent"); // // // Reset all previously set options // curl_reset($ch); // // // Send HTTP request // curl_setopt($ch, CURLOPT_URL, 'http://example.com/'); // curl_exec($ch); // the previously set user-agent will be not sent, it has been reset by curl_reset // // // Close the handle // curl_close($ch); // [/php] // [/example] // [/examples] // // Notes // Note: curl_reset() also resets the URL given as the curl_init() parameter. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-07) // URL: https://www.php.net/manual/en/function.curl-reset.php // ========== CURL_RESET - END // SYNTAX: // void curl_reset(CurlHandle $handle) // Return: void } */ // ============================== END // PHP_OTHER_CURL_CURL_RESET // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_SETOPT_ARRAY // ============================== OFFLINE // ============================== ABOUT // Set multiple options for a cURL transfer. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_setopt_array() - PHP_5 >= PHP_5_1_3, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curl_setopt_array($handle, $options) { $return_curl_setopt_array = false; // ========== CURL_SETOPT_ARRAY - BEGIN // ===== ABOUT // Set multiple options for a cURL transfer // ===== DESCRIPTION // Sets multiple options for a cURL session. This function is useful for setting a large number of cURL options without repetitively calling curl_setopt(). // ===== SUPPORTED // PHP_5 >= PHP_5_1_3, PHP_7, PHP_8 // ===== SYNTAX // curl_setopt_array(CurlHandle $handle, array $options): bool // ===== CODE $return_curl_setopt_array = curl_setopt_array( $handle, // CurlHandle handle - A cURL handle returned by curl_init(). $options // array options - An array specifying which options to set and their values. The keys should be valid curl_setopt() constants or their integer equivalents. ); // Return Values // Returns true if all options were successfully set. If an option could not be successfully set, false is immediately returned, ignoring any future options in the options array. // // Changelog // Version - Description // 8.0.0 - handle expects a CurlHandle instance now; previously, a resource was expected. // // [examples] // Examples // [example] // Example #1 Initializing a new cURL session and fetching a web page // [php] // // create a new cURL resource // $ch = curl_init(); // // // set URL and other appropriate options // $options = array(CURLOPT_URL => 'http://www.example.com/', // CURLOPT_HEADER => false // ); // // curl_setopt_array($ch, $options); // // // grab URL and pass it to the browser // curl_exec($ch); // // // close cURL resource, and free up system resources // curl_close($ch); // [/php] // [/example] // [/examples] // // Notes // Note: As with curl_setopt(), passing an array to CURLOPT_POST will encode the data as multipart/form-data, while passing a URL-encoded string will encode the data as application/x-www-form-urlencoded. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-07) // URL: https://www.php.net/manual/en/function.curl-setopt-array.php // ========== CURL_SETOPT_ARRAY - END // SYNTAX: // bool curl_setopt_array(CurlHandle $handle, array $options) return $return_curl_setopt_array; // bool } */ // ============================== END // PHP_OTHER_CURL_CURL_SETOPT_ARRAY // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_SETOPT // ============================== PUBLIC // ============================== ABOUT // Set an option for a cURL transfer. // ============================== SUPPORT // PHP_4 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_setopt() - PHP_4 >= PHP_4_0_2, PHP_5, PHP_7, PHP_8 // ============================== CODE function php_other_curl_curl_setopt($handle, $option, $value) { $return_curl_setopt = false; // ========== CURL_SETOPT - BEGIN // ===== ABOUT // Set an option for a cURL transfer // ===== DESCRIPTION // Sets an option on the given cURL session handle. // ===== SUPPORTED // PHP_4 >= PHP_4_0_2, PHP_5, PHP_7, PHP_8 // ===== SYNTAX // curl_setopt(CurlHandle $handle, int $option, mixed $value): bool // ===== CODE $return_curl_setopt = curl_setopt( $handle, // CurlHandle handle - A cURL handle returned by curl_init(). $option, // int option - The CURLOPT_XXX option to set. $value // mixed value - The value to be set on option. // // value should be a bool for the following values of the option parameter: // Option - Set value to ; Notes // CURLOPT_AUTOREFERER - true to automatically set the Referer: field in requests where it follows a Location: redirect. ; // CURLOPT_COOKIESESSION - true to mark this as a new cookie "session". It will force libcurl to ignore all cookies it is about to load that are "session cookies" from the previous session. By default, libcurl always stores and loads all cookies, independent if they are session cookies or not. Session cookies are cookies without expiry date and they are meant to be alive and existing for this "session" only. ; // CURLOPT_CERTINFO - true to output SSL certification information to STDERR on secure transfers. ; Added in cURL 7.19.1. Requires CURLOPT_VERBOSE to be on to have an effect. // CURLOPT_CONNECT_ONLY - true tells the library to perform all the required proxy authentication and connection setup, but no data transfer. This option is implemented for HTTP, SMTP and POP3. ; Added in 7.15.2. // CURLOPT_CRLF - true to convert Unix newlines to CRLF newlines on transfers. ; // CURLOPT_DISALLOW_USERNAME_IN_URL - true to not allow URLs that include a username. Usernames are allowed by default (0). ; Added in cURL 7.61.0. Available since PHP 7.3.0. // CURLOPT_DNS_SHUFFLE_ADDRESSES - true to shuffle the order of all returned addresses so that they will be used in a random order, when a name is resolved and more than one IP address is returned. This may cause IPv4 to be used before IPv6 or vice versa. ; Added in cURL 7.60.0. Available since PHP 7.3.0. // CURLOPT_HAPROXYPROTOCOL - true to send an HAProxy PROXY protocol v1 header at the start of the connection. The default action is not to send this header. ; Added in cURL 7.60.0. Available since PHP 7.3.0. // CURLOPT_SSH_COMPRESSION - true to enable built-in SSH compression. This is a request, not an order; the server may or may not do it. ; Added in cURL 7.56.0. Available since PHP 7.3.0. // CURLOPT_DNS_USE_GLOBAL_CACHE - true to use a global DNS cache. This option is not thread-safe. It is conditionally enabled by default if PHP is built for non-threaded use (CLI, FCGI, Apache2-Prefork, etc.). ; // CURLOPT_FAILONERROR - true to fail verbosely if the HTTP code returned is greater than or equal to 400. The default behavior is to return the page normally, ignoring the code. ; // CURLOPT_SSL_FALSESTART - true to enable TLS false start. ; Added in cURL 7.42.0. Available since PHP 7.0.7. // CURLOPT_FILETIME - true to attempt to retrieve the modification date of the remote document. This value can be retrieved using the CURLINFO_FILETIME option with curl_getinfo(). ; // CURLOPT_FOLLOWLOCATION - true to follow any "Location: " header that the server sends as part of the HTTP header. See also CURLOPT_MAXREDIRS. ; // CURLOPT_FORBID_REUSE - true to force the connection to explicitly close when it has finished processing, and not be pooled for reuse. ; // CURLOPT_FRESH_CONNECT - true to force the use of a new connection instead of a cached one. ; // CURLOPT_FTP_USE_EPRT - true to use EPRT (and LPRT) when doing active FTP downloads. Use false to disable EPRT and LPRT and use PORT only. ; // CURLOPT_FTP_USE_EPSV - true to first try an EPSV command for FTP transfers before reverting back to PASV. Set to false to disable EPSV. ; // CURLOPT_FTP_CREATE_MISSING_DIRS - true to create missing directories when an FTP operation encounters a path that currently doesn't exist. ; // CURLOPT_FTPAPPEND - true to append to the remote file instead of overwriting it. ; // CURLOPT_TCP_NODELAY - true to disable TCP's Nagle algorithm, which tries to minimize the number of small packets on the network. ; Available for versions compiled with libcurl 7.11.2 or greater. // CURLOPT_FTPASCII - An alias of CURLOPT_TRANSFERTEXT. Use that instead. ; // CURLOPT_FTPLISTONLY - true to only list the names of an FTP directory. ; // CURLOPT_HEADER - true to include the header in the output. ; // CURLINFO_HEADER_OUT - true to track the handle's request string. ; The CURLINFO_ prefix is intentional. // CURLOPT_HTTP09_ALLOWED - Whether to allow HTTP/0.9 responses. Defaults to false as of libcurl 7.66.0; formerly it defaulted to true. ; Available since PHP 7.3.15 and 7.4.3, respectively, if built against libcurl >= 7.64.0 // CURLOPT_HTTPGET - true to reset the HTTP request method to GET. Since GET is the default, this is only necessary if the request method has been changed. ; // CURLOPT_HTTPPROXYTUNNEL - true to tunnel through a given HTTP proxy. ; // CURLOPT_HTTP_CONTENT_DECODING - false to get the raw HTTP response body. ; Available if built against libcurl >= 7.16.2. // CURLOPT_KEEP_SENDING_ON_ERROR - true to keep sending the request body if the HTTP code returned is equal to or larger than 300. The default action would be to stop sending and close the stream or connection. Suitable for manual NTLM authentication. Most applications do not need this option. ; Available as of PHP 7.3.0 if built against libcurl >= 7.51.0. // CURLOPT_MUTE - true to be completely silent with regards to the cURL functions. ; Removed in cURL 7.15.5 (You can use CURLOPT_RETURNTRANSFER instead) // CURLOPT_NETRC - true to scan the ~/.netrc file to find a username and password for the remote site that a connection is being established with. ; // CURLOPT_NOBODY - true to exclude the body from the output. Request method is then set to HEAD. Changing this to false does not change it to GET. ; // CURLOPT_NOPROGRESS - true to disable the progress meter for cURL transfers. Note: PHP automatically sets this option to true, this should only be changed for debugging purposes. ; // CURLOPT_NOSIGNAL - true to ignore any cURL function that causes a signal to be sent to the PHP process. This is turned on by default in multi-threaded SAPIs so timeout options can still be used. ; Added in cURL 7.10. // CURLOPT_PATH_AS_IS - true to not handle dot dot sequences. ; Added in cURL 7.42.0. Available since PHP 7.0.7. // CURLOPT_PIPEWAIT - true to wait for pipelining/multiplexing. ; Added in cURL 7.43.0. Available since PHP 7.0.7. // CURLOPT_POST - true to do a regular HTTP POST. This POST is the normal application/x-www-form-urlencoded kind, most commonly used by HTML forms. ; // CURLOPT_PUT - true to HTTP PUT a file. The file to PUT must be set with CURLOPT_INFILE and CURLOPT_INFILESIZE. ; // CURLOPT_RETURNTRANSFER - true to return the transfer as a string of the return value of curl_exec() instead of outputting it directly. ; // CURLOPT_SASL_IR - true to enable sending the initial response in the first packet. ; Added in cURL 7.31.10. Available since PHP 7.0.7. // CURLOPT_SSL_ENABLE_ALPN - false to disable ALPN in the SSL handshake (if the SSL backend libcurl is built to use supports it), which can be used to negotiate http2. ; Added in cURL 7.36.0. Available since PHP 7.0.7. // CURLOPT_SSL_ENABLE_NPN - false to disable NPN in the SSL handshake (if the SSL backend libcurl is built to use supports it), which can be used to negotiate http2. ; Added in cURL 7.36.0. Available since PHP 7.0.7. // CURLOPT_SSL_VERIFYPEER - false to stop cURL from verifying the peer's certificate. Alternate certificates to verify against can be specified with the CURLOPT_CAINFO option or a certificate directory can be specified with the CURLOPT_CAPATH option. ; true by default as of cURL 7.10. Default bundle installed as of cURL 7.10. // CURLOPT_SSL_VERIFYSTATUS - true to verify the certificate's status. ; Added in cURL 7.41.0. Available since PHP 7.0.7. // CURLOPT_PROXY_SSL_VERIFYPEER - false to stop cURL from verifying the peer's certificate. Alternate certificates to verify against can be specified with the CURLOPT_CAINFO option or a certificate directory can be specified with the CURLOPT_CAPATH option. When set to false, the peer certificate verification succeeds regardless. ; true by default. Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. // CURLOPT_SAFE_UPLOAD - Always true, what disables support for the @ prefix for uploading files in CURLOPT_POSTFIELDS, which means that values starting with @ can be safely passed as fields. CURLFile may be used for uploads instead. ; // CURLOPT_SUPPRESS_CONNECT_HEADERS - true to suppress proxy CONNECT response headers from the user callback functions CURLOPT_HEADERFUNCTION and CURLOPT_WRITEFUNCTION, when CURLOPT_HTTPPROXYTUNNEL is used and a CONNECT request is made. ; Added in cURL 7.54.0. Available since PHP 7.3.0. // CURLOPT_TCP_FASTOPEN - true to enable TCP Fast Open. ; Added in cURL 7.49.0. Available since PHP 7.0.7. // CURLOPT_TFTP_NO_OPTIONS - true to not send TFTP options requests. ; Added in cURL 7.48.0. Available since PHP 7.0.7. // CURLOPT_TRANSFERTEXT - true to use ASCII mode for FTP transfers. For LDAP, it retrieves data in plain text instead of HTML. On Windows systems, it will not set STDOUT to binary mode. ; // CURLOPT_UNRESTRICTED_AUTH - true to keep sending the username and password when following locations (using CURLOPT_FOLLOWLOCATION), even when the hostname has changed. ; // CURLOPT_UPLOAD - true to prepare for an upload. ; // CURLOPT_VERBOSE - true to output verbose information. Writes output to STDERR, or the file specified using CURLOPT_STDERR. ; // // value should be an int for the following values of the option parameter: // Option - Set value to ; Notes // CURLOPT_BUFFERSIZE - The size of the buffer to use for each read. There is no guarantee this request will be fulfilled, however. ; Added in cURL 7.10. // CURLOPT_CONNECTTIMEOUT - The number of seconds to wait while trying to connect. Use 0 to wait indefinitely. ; // CURLOPT_CONNECTTIMEOUT_MS - The number of milliseconds to wait while trying to connect. Use 0 to wait indefinitely. If libcurl is built to use the standard system name resolver, that portion of the connect will still use full-second resolution for timeouts with a minimum timeout allowed of one second. ; Added in cURL 7.16.2. // CURLOPT_DNS_CACHE_TIMEOUT - The number of seconds to keep DNS entries in memory. This option is set to 120 (2 minutes) by default. ; // CURLOPT_EXPECT_100_TIMEOUT_MS - The timeout for Expect: 100-continue responses in milliseconds. Defaults to 1000 milliseconds. ; Added in cURL 7.36.0. Available since PHP 7.0.7. // CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS - Head start for ipv6 for the happy eyeballs algorithm. Happy eyeballs attempts to connect to both IPv4 and IPv6 addresses for dual-stack hosts, preferring IPv6 first for timeout milliseconds. Defaults to CURL_HET_DEFAULT, which is currently 200 milliseconds. ; Added in cURL 7.59.0. Available since PHP 7.3.0. // CURLOPT_FTPSSLAUTH - The FTP authentication method (when is activated): CURLFTPAUTH_SSL (try SSL first), CURLFTPAUTH_TLS (try TLS first), or CURLFTPAUTH_DEFAULT (let cURL decide). ; Added in cURL 7.12.2. // CURLOPT_HEADEROPT - How to deal with headers. One of the following constants: CURLHEADER_UNIFIED: the headers specified in CURLOPT_HTTPHEADER will be used in requests both to servers and proxies. With this option enabled, CURLOPT_PROXYHEADER will not have any effect. CURLHEADER_SEPARATE: makes CURLOPT_HTTPHEADER headers only get sent to a server and not to a proxy. Proxy headers must be set with CURLOPT_PROXYHEADER to get used. Note that if a non-CONNECT request is sent to a proxy, libcurl will send both server headers and proxy headers. When doing CONNECT, libcurl will send CURLOPT_PROXYHEADER headers only to the proxy and then CURLOPT_HTTPHEADER headers only to the server. Defaults to CURLHEADER_SEPARATE as of cURL 7.42.1, and CURLHEADER_UNIFIED before. ; Added in cURL 7.37.0. Available since PHP 7.0.7. // CURLOPT_HTTP_VERSION - CURL_HTTP_VERSION_NONE (default, lets CURL decide which version to use), CURL_HTTP_VERSION_1_0 (forces HTTP/1.0), CURL_HTTP_VERSION_1_1 (forces HTTP/1.1), CURL_HTTP_VERSION_2_0 (attempts HTTP 2), CURL_HTTP_VERSION_2 (alias of CURL_HTTP_VERSION_2_0), CURL_HTTP_VERSION_2TLS (attempts HTTP 2 over TLS (HTTPS) only) or CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE (issues non-TLS HTTP requests using HTTP/2 without HTTP/1.1 Upgrade). ; // CURLOPT_HTTPAUTH - The HTTP authentication method(s) to use. The options are: CURLAUTH_BASIC, CURLAUTH_DIGEST, CURLAUTH_GSSNEGOTIATE, CURLAUTH_NTLM, CURLAUTH_AWS_SIGV4, CURLAUTH_ANY, and CURLAUTH_ANYSAFE. // The bitwise | (or) operator can be used to combine more than one method. If this is done, cURL will poll the server to see what methods it supports and pick the best one. // CURLAUTH_ANY - sets all bits. cURL will automatically select the one it finds most secure. // CURLAUTH_ANYSAFE - sets all bits except CURLAUTH_BASIC. cURL will automatically select the one it finds most secure. ; // CURLOPT_INFILESIZE - The expected size, in bytes, of the file when uploading a file to a remote site. Note that using this option will not stop libcurl from sending more data, as exactly what is sent depends on CURLOPT_READFUNCTION. ; // CURLOPT_LOW_SPEED_LIMIT - The transfer speed, in bytes per second, that the transfer should be below during the count of CURLOPT_LOW_SPEED_TIME seconds before PHP considers the transfer too slow and aborts. ; // CURLOPT_LOW_SPEED_TIME - The number of seconds the transfer speed should be below CURLOPT_LOW_SPEED_LIMIT before PHP considers the transfer too slow and aborts. ; // CURLOPT_MAIL_RCPT_ALLLOWFAILS - Allow RCPT TO command to fail for some recipients. ; When sending data to multiple recipients, by default cURL will abort SMTP conversation if at least one of the recipients causes RCPT TO command to return an error. This option tells cURL to ignore errors and proceed with the remaining valid recipients. If all recipients trigger RCPT TO failures and this flag is set, cURL will abort the SMTP conversation and return the error received from the last RCPT TO command. // CURLOPT_MAXAGE_CONN - The maximum idle time allowed for an existing connection to be considered for reuse. Default maximum age is set to 118 seconds. ; // CURLOPT_MAXFILESIZE_LARGE - The maximum file size in bytes allowed to download. If the file requested is found larger than this value, the transfer will not start and CURLE_FILESIZE_EXCEEDED will be returned. The file size is not always known prior to download, and for such files this option has no effect even if the file transfer ends up being larger than this given limit. ; // CURLOPT_MAXLIFETIME_CONN - The maximum time in seconds, since the creation of the connection, that is allowed for an existing connection to have for it to be considered for reuse. If a connection is found in the cache that is older than this value, it will instead be closed once any in-progress transfers are complete. Default is 0 seconds, meaning the option is disabled and all connections are eligible for reuse. ; // CURLOPT_MAXCONNECTS - The maximum amount of persistent connections that are allowed. When the limit is reached, the oldest one in the cache is closed to prevent increasing the number of open connections. ; // CURLOPT_MAXREDIRS - The maximum amount of HTTP redirections to follow. Use this option alongside CURLOPT_FOLLOWLOCATION. Default value of 20 is set to prevent infinite redirects. Setting to -1 allows inifinite redirects, and 0 refuses all redirects. ; // CURLOPT_PORT - An alternative port number to connect to. ; // CURLOPT_POSTREDIR - A bitmask of 1 (301 Moved Permanently), 2 (302 Found) and 4 (303 See Other) if the HTTP POST method should be maintained when CURLOPT_FOLLOWLOCATION is set and a specific type of redirect occurs. ; Added in cURL 7.19.1. // CURLOPT_PROTOCOLS - Bitmask of CURLPROTO_* values. If used, this bitmask limits what protocols libcurl may use in the transfer. This allows you to have a libcurl built to support a wide range of protocols but still limit specific transfers to only be allowed to use a subset of them. By default libcurl will accept all protocols it supports. See also CURLOPT_REDIR_PROTOCOLS. // Valid protocol options are: CURLPROTO_HTTP, CURLPROTO_HTTPS, CURLPROTO_FTP, CURLPROTO_FTPS, CURLPROTO_SCP, CURLPROTO_SFTP, CURLPROTO_TELNET, CURLPROTO_LDAP, CURLPROTO_LDAPS, CURLPROTO_DICT, CURLPROTO_FILE, CURLPROTO_TFTP, CURLPROTO_MQTT, CURLPROTO_ALL ; Added in cURL 7.19.4. // CURLOPT_PROXYAUTH - The HTTP authentication method(s) to use for the proxy connection. Use the same bitmasks as described in CURLOPT_HTTPAUTH. For proxy authentication, only CURLAUTH_BASIC and CURLAUTH_NTLM are currently supported. ; Added in cURL 7.10.7. // CURLOPT_PROXYPORT - The port number of the proxy to connect to. This port number can also be set in CURLOPT_PROXY. ; // CURLOPT_PROXYTYPE - Either CURLPROXY_HTTP (default), CURLPROXY_SOCKS4, CURLPROXY_SOCKS5, CURLPROXY_SOCKS4A or CURLPROXY_SOCKS5_HOSTNAME. ; Added in cURL 7.10. // CURLOPT_REDIR_PROTOCOLS - Bitmask of CURLPROTO_* values. If used, this bitmask limits what protocols libcurl may use in a transfer that it follows to in a redirect when CURLOPT_FOLLOWLOCATION is enabled. This allows you to limit specific transfers to only be allowed to use a subset of protocols in redirections. By default libcurl will allow all protocols except for FILE and SCP. This is a difference compared to pre-7.19.4 versions which unconditionally would follow to all protocols supported. See also CURLOPT_PROTOCOLS for protocol constant values. ; Added in cURL 7.19.4. // CURLOPT_RESUME_FROM - The offset, in bytes, to resume a transfer from. ; // CURLOPT_SOCKS5_AUTH - The SOCKS5 authentication method(s) to use. The options are: CURLAUTH_BASIC, CURLAUTH_GSSAPI, CURLAUTH_NONE. // The bitwise | (or) operator can be used to combine more than one method. If this is done, cURL will poll the server to see what methods it supports and pick the best one. // CURLAUTH_BASIC - allows username/password authentication. // CURLAUTH_GSSAPI - allows GSS-API authentication. // CURLAUTH_NONE - allows no authentication. // Defaults to CURLAUTH_BASIC|CURLAUTH_GSSAPI. Set the actual username and password with the CURLOPT_PROXYUSERPWD option. ; Available as of 7.3.0 and curl >= 7.55.0. // CURLOPT_SSL_OPTIONS - Set SSL behavior options, which is a bitmask of any of the following constants: CURLSSLOPT_ALLOW_BEAST: do not attempt to use any workarounds for a security flaw in the SSL3 and TLS1.0 protocols. CURLSSLOPT_NO_REVOKE: disable certificate revocation checks for those SSL backends where such behavior is present. CURLSSLOPT_AUTO_CLIENT_CERT: automatically locate and use a client certificate for authentication, when requested by the server. This option is only supported for Schannel (the native Windows SSL library). CURLSSLOPT_NATIVE_CA: use the operating system's native CA store for certificate verification. Works only on Windows when built to use OpenSSL. This option is experimental and behavior is subject to change. CURLSSLOPT_NO_PARTIALCHAIN: do not accept "partial" certificate chains, which cURL otherwise does by default. This option is only supported for OpenSSL and will fail the certificate verification if the chain ends with an intermediate certificate and not with a root certificate. CURLSSLOPT_REVOKE_BEST_EFFORT: ignore certificate revocation checks in case of missing or offline distribution points for those SSL backends where such behavior is present. This option is only supported for Schannel (the native Windows SSL library). If combined with CURLSSLOPT_NO_REVOKE, the latter takes precedence. ; Added in cURL 7.25.0. Available since PHP 7.0.7. // CURLOPT_SSL_VERIFYHOST - 2 to verify that a Common Name field or a Subject Alternate Name field in the SSL peer certificate matches the provided hostname. 0 to not check the names. 1 should not be used. In production environments the value of this option should be kept at 2 (default value). ; Support for value 1 removed in cURL 7.28.1. // CURLOPT_SSLVERSION - One of CURL_SSLVERSION_DEFAULT (0), CURL_SSLVERSION_TLSv1 (1), CURL_SSLVERSION_SSLv2 (2), CURL_SSLVERSION_SSLv3 (3), CURL_SSLVERSION_TLSv1_0 (4), CURL_SSLVERSION_TLSv1_1 (5), CURL_SSLVERSION_TLSv1_2 (6) or CURL_SSLVERSION_TLSv1_3 (7). The maximum TLS version can be set by using one of the CURL_SSLVERSION_MAX_* constants. It is also possible to OR one of the CURL_SSLVERSION_* constants with one of the CURL_SSLVERSION_MAX_* constants. CURL_SSLVERSION_MAX_DEFAULT (the maximum version supported by the library), CURL_SSLVERSION_MAX_TLSv1_0, CURL_SSLVERSION_MAX_TLSv1_1, CURL_SSLVERSION_MAX_TLSv1_2, or CURL_SSLVERSION_MAX_TLSv1_3. // Note: Your best bet is to not set this and let it use the default. Setting it to 2 or 3 is very dangerous given the known vulnerabilities in SSLv2 and SSLv3. ; // CURLOPT_PROXY_SSL_OPTIONS - Set proxy SSL behavior options, which is a bitmask of any of the following constants: CURLSSLOPT_ALLOW_BEAST: do not attempt to use any workarounds for a security flaw in the SSL3 and TLS1.0 protocols. CURLSSLOPT_NO_REVOKE: disable certificate revocation checks for those SSL backends where such behavior is present. (curl >= 7.44.0) CURLSSLOPT_NO_PARTIALCHAIN: do not accept "partial" certificate chains, which it otherwise does by default. (curl >= 7.68.0) ; Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. // CURLOPT_PROXY_SSL_VERIFYHOST - Set to 2 to verify in the HTTPS proxy's certificate name fields against the proxy name. When set to 0 the connection succeeds regardless of the names used in the certificate. Use that ability with caution! 1 treated as a debug option in curl 7.28.0 and earlier. From curl 7.28.1 to 7.65.3 CURLE_BAD_FUNCTION_ARGUMENT is returned. From curl 7.66.0 onwards 1 and 2 is treated as the same value. In production environments the value of this option should be kept at 2 (default value). ; Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. // CURLOPT_PROXY_SSLVERSION - One of CURL_SSLVERSION_DEFAULT, CURL_SSLVERSION_TLSv1, CURL_SSLVERSION_TLSv1_0, CURL_SSLVERSION_TLSv1_1, CURL_SSLVERSION_TLSv1_2, CURL_SSLVERSION_TLSv1_3, CURL_SSLVERSION_MAX_DEFAULT, CURL_SSLVERSION_MAX_TLSv1_0, CURL_SSLVERSION_MAX_TLSv1_1, CURL_SSLVERSION_MAX_TLSv1_2, CURL_SSLVERSION_MAX_TLSv1_3 or CURL_SSLVERSION_SSLv3. // Note: Your best bet is to not set this and let it use the default CURL_SSLVERSION_DEFAULT which will attempt to figure out the remote SSL protocol version. // ; Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. // CURLOPT_STREAM_WEIGHT - Set the numerical stream weight (a number between 1 and 256). ; Added in cURL 7.46.0. Available since PHP 7.0.7. // CURLOPT_TCP_KEEPALIVE - If set to 1, TCP keepalive probes will be sent. The delay and frequency of these probes can be controlled by the CURLOPT_TCP_KEEPIDLE and CURLOPT_TCP_KEEPINTVL options, provided the operating system supports them. If set to 0 (default) keepalive probes are disabled. ; Added in cURL 7.25.0. // CURLOPT_TCP_KEEPIDLE - Sets the delay, in seconds, that the operating system will wait while the connection is idle before sending keepalive probes, if CURLOPT_TCP_KEEPALIVE is enabled. Not all operating systems support this option. The default is 60. ; Added in cURL 7.25.0. // CURLOPT_TCP_KEEPINTVL - Sets the interval, in seconds, that the operating system will wait between sending keepalive probes, if CURLOPT_TCP_KEEPALIVE is enabled. Not all operating systems support this option. The default is 60. ; Added in cURL 7.25.0. // CURLOPT_TIMECONDITION - How CURLOPT_TIMEVALUE is treated. Use CURL_TIMECOND_IFMODSINCE to return the page only if it has been modified since the time specified in CURLOPT_TIMEVALUE. If it hasn't been modified, a "304 Not Modified" header will be returned assuming CURLOPT_HEADER is true. Use CURL_TIMECOND_IFUNMODSINCE for the reverse effect. Use CURL_TIMECOND_NONE to ignore CURLOPT_TIMEVALUE and always return the page. CURL_TIMECOND_NONE is the default. ; Before cURL 7.46.0 the default was CURL_TIMECOND_IFMODSINCE. // CURLOPT_TIMEOUT - The maximum number of seconds to allow cURL functions to execute. ; // CURLOPT_TIMEOUT_MS - The maximum number of milliseconds to allow cURL functions to execute. If libcurl is built to use the standard system name resolver, that portion of the connect will still use full-second resolution for timeouts with a minimum timeout allowed of one second. ; Added in cURL 7.16.2. // CURLOPT_TIMEVALUE - The time in seconds since January 1st, 1970. The time will be used by CURLOPT_TIMECONDITION. ; // CURLOPT_TIMEVALUE_LARGE - The time in seconds since January 1st, 1970. The time will be used by CURLOPT_TIMECONDITION. Defaults to zero. The difference between this option and CURLOPT_TIMEVALUE is the type of the argument. On systems where 'long' is only 32 bit wide, this option has to be used to set dates beyond the year 2038. ; Added in cURL 7.59.0. Available since PHP 7.3.0. // CURLOPT_UPKEEP_INTERVAL_MS - Some protocols have "connection upkeep" mechanisms. These mechanisms usually send some traffic on existing connections in order to keep them alive. This option defines the connection upkeep interval. Currently, the only protocol with a connection upkeep mechanism is HTTP/2. When the connection upkeep interval is exceeded, an HTTP/2 PING frame is sent on the connection. Default is 60 seconds. ; // CURLOPT_UPLOAD_BUFFERSIZE - Preferred buffer size in bytes for the cURL upload buffer. The upload buffer size by default is 64 kilobytes. The maximum buffer size allowed to be set is 2 megabytes. The minimum buffer size allowed to be set is 16 kilobytes. ; // CURLOPT_MAX_RECV_SPEED_LARGE - If a download exceeds this speed (counted in bytes per second) on cumulative average during the transfer, the transfer will pause to keep the average rate less than or equal to the parameter value. Defaults to unlimited speed. ; Added in cURL 7.15.5. // CURLOPT_MAX_SEND_SPEED_LARGE - If an upload exceeds this speed (counted in bytes per second) on cumulative average during the transfer, the transfer will pause to keep the average rate less than or equal to the parameter value. Defaults to unlimited speed. ; Added in cURL 7.15.5. // CURLOPT_SSH_AUTH_TYPES - A bitmask consisting of one or more of CURLSSH_AUTH_PUBLICKEY, CURLSSH_AUTH_PASSWORD, CURLSSH_AUTH_HOST, CURLSSH_AUTH_KEYBOARD. Set to CURLSSH_AUTH_ANY to let libcurl pick one. ; Added in cURL 7.16.1. // CURLOPT_IPRESOLVE - Allows an application to select what kind of IP addresses to use when resolving host names. This is only interesting when using host names that resolve addresses using more than one version of IP, possible values are CURL_IPRESOLVE_WHATEVER, CURL_IPRESOLVE_V4, CURL_IPRESOLVE_V6, by default CURL_IPRESOLVE_WHATEVER. ; Added in cURL 7.10.8. // CURLOPT_FTP_FILEMETHOD - Tell curl which method to use to reach a file on a FTP(S) server. Possible values are CURLFTPMETHOD_DEFAULT, CURLFTPMETHOD_MULTICWD, CURLFTPMETHOD_NOCWD, and CURLFTPMETHOD_SINGLECWD. ; Added in cURL 7.15.1. // value should be a string for the following values of the option parameter: // // Option - Set value to ; Notes // CURLOPT_ABSTRACT_UNIX_SOCKET - Enables the use of an abstract Unix domain socket instead of establishing a TCP connection to a host and sets the path to the given string. This option shares the same semantics as CURLOPT_UNIX_SOCKET_PATH. These two options share the same storage and therefore only one of them can be set per handle. ; Available since PHP 7.3.0 and cURL 7.53.0 // CURLOPT_ALTSVC - Pass the filename for cURL to use as the Alt-Svc cache file to read existing cache contents from and possibly also write it back to a after a transfer, unless CURLALTSVC_READONLYFILE is set via CURLOPT_ALTSVC_CTRL. ; // CURLOPT_ALTSVC_CTRL - Populate the bitmask with the correct set of features to instruct cURL how to handle Alt-Svc for the transfers using this handle. cURL only accepts Alt-Svc headers over HTTPS. It will also only complete a request to an alternative origin if that origin is properly hosted over HTTPS. Setting any bit will enable the alt-svc engine. The options are: CURLALTSVC_H1, CURLALTSVC_H2, CURLALTSVC_H3, and CURLALTSVC_READONLYFILE. ; // CURLOPT_AWS_SIGV4 - Provides AWS V4 signature authentication on HTTP(S) header. // This option overrides any other authentication types that have been set in CURLOPT_HTTPAUTH. This method cannot be combined with other authentication types. ; // CURLOPT_CAINFO - The name of a file holding one or more certificates to verify the peer with. This only makes sense when used in combination with CURLOPT_SSL_VERIFYPEER. ; Might require an absolute path. // CURLOPT_CAINFO_BLOB - The name of a PEM file holding one or more certificates to verify the peer with. This option overrides CURLOPT_CAINFO. ; Available as of PHP 8.2.0 and cURL 7.77.0 // CURLOPT_CAPATH - A directory that holds multiple CA certificates. Use this option alongside CURLOPT_SSL_VERIFYPEER. ; // CURLOPT_COOKIE - The contents of the "Cookie: " header to be used in the HTTP request. Note that multiple cookies are separated with a semicolon followed by a space (e.g., "fruit=apple; colour=red") ; // CURLOPT_COOKIEFILE - The name of the file containing the cookie data. The cookie file can be in Netscape format, or just plain HTTP-style headers dumped into a file. If the name is an empty string, no cookies are loaded, but cookie handling is still enabled. ; // CURLOPT_COOKIEJAR - The name of a file to save all internal cookies to when the handle is closed, e.g. after a call to curl_close. ; // CURLOPT_COOKIELIST - A cookie string (i.e. a single line in Netscape/Mozilla format, or a regular HTTP-style Set-Cookie header) adds that single cookie to the internal cookie store. "ALL" erases all cookies held in memory. "SESS" erases all session cookies held in memory. "FLUSH" writes all known cookies to the file specified by CURLOPT_COOKIEJAR. "RELOAD" loads all cookies from the files specified by CURLOPT_COOKIEFILE. ; Available since cURL 7.14.1. // CURLOPT_CUSTOMREQUEST - A custom request method to use instead of "GET" or "HEAD" when doing a HTTP request. This is useful for doing "DELETE" or other, more obscure HTTP requests. Valid values are things like "GET", "POST", "CONNECT" and so on; i.e. Do not enter a whole HTTP request line here. For instance, entering "GET /index.html HTTP/1.0\r\n\r\n" would be incorrect. // Note: Don't do this without making sure the server supports the custom request method first. ; // CURLOPT_DEFAULT_PROTOCOL - The default protocol to use if the URL is missing a scheme name. ; Added in cURL 7.45.0. Available since PHP 7.0.7. // CURLOPT_DNS_INTERFACE - Set the name of the network interface that the DNS resolver should bind to. This must be an interface name (not an address). ; Added in cURL 7.33.0. Available since PHP 7.0.7. // CURLOPT_DNS_LOCAL_IP4 - Set the local IPv4 address that the resolver should bind to. The argument should contain a single numerical IPv4 address as a string. ; Added in cURL 7.33.0. Available since PHP 7.0.7. // CURLOPT_DNS_LOCAL_IP6 - Set the local IPv6 address that the resolver should bind to. The argument should contain a single numerical IPv6 address as a string. ; Added in cURL 7.33.0. Available since PHP 7.0.7. // CURLOPT_EGDSOCKET - Like CURLOPT_RANDOM_FILE, except a filename to an Entropy Gathering Daemon socket. ; // CURLOPT_ENCODING - The contents of the "Accept-Encoding: " header. This enables decoding of the response. Supported encodings are "identity", "deflate", and "gzip". If an empty string, "", is set, a header containing all supported encoding types is sent. ; Added in cURL 7.10. // CURLOPT_FTPPORT - The value which will be used to get the IP address to use for the FTP "PORT" instruction. The "PORT" instruction tells the remote server to connect to our specified IP address. The string may be a plain IP address, a hostname, a network interface name (under Unix), or just a plain '-' to use the systems default IP address. ; // CURLOPT_HSTS - HSTS (HTTP Strict Transport Security) cache file name. ; // CURLOPT_HSTS_CTRL - Controls HSTS (HTTP Strict Transport Security) behavior. Populate the bitmask with the correct set of features to instruct cURL how to handle HSTS for the transfers using this handle. CURLHSTS_ENABLE enables the in-memory HSTS cache. If the HSTS cache file is defined, set CURLHSTS_READONLYFILE to make the file read-only. ; // CURLOPT_INTERFACE - The name of the outgoing network interface to use. This can be an interface name, an IP address or a host name. ; // CURLOPT_KEYPASSWD - The password required to use the CURLOPT_SSLKEY or CURLOPT_SSH_PRIVATE_KEYFILE private key. ; Added in cURL 7.16.1. // CURLOPT_KRB4LEVEL - The KRB4 (Kerberos 4) security level. Any of the following values (in order from least to most powerful) are valid: "clear", "safe", "confidential", "private".. If the string does not match one of these, "private" is used. Setting this option to null will disable KRB4 security. Currently KRB4 security only works with FTP transactions. ; // CURLOPT_LOGIN_OPTIONS - Can be used to set protocol specific login options, such as the preferred authentication mechanism via "AUTH=NTLM" or "AUTH=*", and should be used in conjunction with the CURLOPT_USERNAME option. ; Added in cURL 7.34.0. Available since PHP 7.0.7. // CURLOPT_PINNEDPUBLICKEY - Set the pinned public key. The string can be the file name of your pinned public key. The file format expected is "PEM" or "DER". The string can also be any number of base64 encoded sha256 hashes preceded by "sha256//" and separated by ";". ; Added in cURL 7.39.0. Available since PHP 7.0.7. // CURLOPT_POSTFIELDS - The full data to post in a HTTP "POST" operation. This parameter can either be passed as a urlencoded string like 'para1=val1¶2=val2&...' or as an array with the field name as key and field data as value. If value is an array, the Content-Type header will be set to multipart/form-data. Files can be sent using CURLFile or CURLStringFile, in which case value must be an array. ; // CURLOPT_PRIVATE - Any data that should be associated with this cURL handle. This data can subsequently be retrieved with the CURLINFO_PRIVATE option of curl_getinfo(). cURL does nothing with this data. When using a cURL multi handle, this private data is typically a unique key to identify a standard cURL handle. ; Added in cURL 7.10.3. // CURLOPT_PRE_PROXY - Set a string holding the host name or dotted numerical IP address to be used as the preproxy that curl connects to before it connects to the HTTP(S) proxy specified in the CURLOPT_PROXY option for the upcoming request. The preproxy can only be a SOCKS proxy and it should be prefixed with [scheme]:// to specify which kind of socks is used. A numerical IPv6 address must be written within [brackets]. Setting the preproxy to an empty string explicitly disables the use of a preproxy. To specify port number in this string, append :[port] to the end of the host name. The proxy's port number may optionally be specified with the separate option CURLOPT_PROXYPORT. Defaults to using port 1080 for proxies if a port is not specified. ; Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. // CURLOPT_PROXY - The HTTP proxy to tunnel requests through. ; Added in cURL 7.10.3. // CURLOPT_PROXY_SERVICE_NAME - The proxy authentication service name. ; Added in cURL 7.43.0 for HTTP proxies, and in cURL 7.49.0 for SOCKS5 proxies. Available since PHP 7.0.7. // CURLOPT_PROXY_CAINFO - The path to proxy Certificate Authority (CA) bundle. Set the path as a string naming a file holding one or more certificates to verify the HTTPS proxy with. This option is for connecting to an HTTPS proxy, not an HTTPS server. Defaults set to the system path where libcurl's cacert bundle is assumed to be stored. ; Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. // CURLOPT_PROXY_CAINFO_BLOB - The name of a PEM file holding one or more certificates to verify the HTTPS proxy with. This option is for connecting to an HTTPS proxy, not an HTTPS server. Defaults set to the system path where libcurl's cacert bundle is assumed to be stored. ; Available as of PHP 8.2.0 and libcurl >= cURL 7.77.0. // CURLOPT_PROXY_CAPATH - The directory holding multiple CA certificates to verify the HTTPS proxy with. ; Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. // CURLOPT_PROXY_CRLFILE - Set the file name with the concatenation of CRL (Certificate Revocation List) in PEM format to use in the certificate validation that occurs during the SSL exchange. ; Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. // CURLOPT_PROXY_KEYPASSWD - Set the string be used as the password required to use the CURLOPT_PROXY_SSLKEY private key. You never needed a passphrase to load a certificate but you need one to load your private key. This option is for connecting to an HTTPS proxy, not an HTTPS server. ; Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. // CURLOPT_PROXY_PINNEDPUBLICKEY - Set the pinned public key for HTTPS proxy. The string can be the file name of your pinned public key. The file format expected is "PEM" or "DER". The string can also be any number of base64 encoded sha256 hashes preceded by "sha256//" and separated by ";" ; Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. // CURLOPT_PROXY_SSLCERT - The file name of your client certificate used to connect to the HTTPS proxy. The default format is "P12" on Secure Transport and "PEM" on other engines, and can be changed with CURLOPT_PROXY_SSLCERTTYPE. With NSS or Secure Transport, this can also be the nickname of the certificate you wish to authenticate with as it is named in the security database. If you want to use a file from the current directory, please precede it with "./" prefix, in order to avoid confusion with a nickname. ; Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. // CURLOPT_PROXY_SSLCERTTYPE - The format of your client certificate used when connecting to an HTTPS proxy. Supported formats are "PEM" and "DER", except with Secure Transport. OpenSSL (versions 0.9.3 and later) and Secure Transport (on iOS 5 or later, or OS X 10.7 or later) also support "P12" for PKCS#12-encoded files. Defaults to "PEM". ; Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. // CURLOPT_PROXY_SSL_CIPHER_LIST - The list of ciphers to use for the connection to the HTTPS proxy. The list must be syntactically correct, it consists of one or more cipher strings separated by colons. Commas or spaces are also acceptable separators but colons are normally used, !, - and + can be used as operators. ; Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. // CURLOPT_PROXY_TLS13_CIPHERS - The list of cipher suites to use for the TLS 1.3 connection to a proxy. The list must be syntactically correct, it consists of one or more cipher suite strings separated by colons. This option is currently used only when curl is built to use OpenSSL 1.1.1 or later. If you are using a different SSL backend you can try setting TLS 1.3 cipher suites by using the CURLOPT_PROXY_SSL_CIPHER_LIST option. ; Available since PHP 7.3.0 and libcurl >= cURL 7.61.0. Available when built with OpenSSL >= 1.1.1. // CURLOPT_PROXY_SSLKEY - The file name of your private key used for connecting to the HTTPS proxy. The default format is "PEM" and can be changed with CURLOPT_PROXY_SSLKEYTYPE. (iOS and Mac OS X only) This option is ignored if curl was built against Secure Transport. ; Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. Available if built TLS enabled. // CURLOPT_PROXY_SSLKEYTYPE - The format of your private key. Supported formats are "PEM", "DER" and "ENG". ; Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. // CURLOPT_PROXY_TLSAUTH_PASSWORD - The password to use for the TLS authentication method specified with the CURLOPT_PROXY_TLSAUTH_TYPE option. Requires that the CURLOPT_PROXY_TLSAUTH_USERNAME option to also be set. ; Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. // CURLOPT_PROXY_TLSAUTH_TYPE - The method of the TLS authentication used for the HTTPS connection. Supported method is "SRP". // Note: Secure Remote Password (SRP) authentication for TLS provides mutual authentication if both sides have a shared secret. To use TLS-SRP, you must also set the CURLOPT_PROXY_TLSAUTH_USERNAME and CURLOPT_PROXY_TLSAUTH_PASSWORD options. // ; Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. // CURLOPT_PROXY_TLSAUTH_USERNAME - The username to use for the HTTPS proxy TLS authentication method specified with the CURLOPT_PROXY_TLSAUTH_TYPE option. Requires that the CURLOPT_PROXY_TLSAUTH_PASSWORD option to also be set. ; Available since PHP 7.3.0 and libcurl >= cURL 7.52.0. // CURLOPT_PROXYUSERPWD - A username and password formatted as "[username]:[password]" to use for the connection to the proxy. ; // CURLOPT_RANDOM_FILE - A filename to be used to seed the random number generator for SSL. ; // CURLOPT_RANGE - Range(s) of data to retrieve in the format "X-Y" where X or Y are optional. HTTP transfers also support several intervals, separated with commas in the format "X-Y,N-M". ; // CURLOPT_REFERER - The contents of the "Referer: " header to be used in a HTTP request. ; // CURLOPT_SASL_AUTHZID - The authorization identity (authzid) for the transfer. Only applicable to the PLAIN SASL authentication mechanism where it is optional. When not specified, only the authentication identity (authcid) as specified by the username will be sent to the server, along with the password. The server will derive the authzid from the authcid when not provided, which it will then use internally. ; // CURLOPT_SERVICE_NAME - The authentication service name. ; Added in cURL 7.43.0. Available since PHP 7.0.7. // CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 - A string containing 32 hexadecimal digits. The string should be the MD5 checksum of the remote host's public key, and libcurl will reject the connection to the host unless the md5sums match. This option is only for SCP and SFTP transfers. ; Added in cURL 7.17.1. // CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256 - Base64-encoded SHA256 hash of the remote host's public key. The transfer will fail if the given hash does not match the hash the remote host provides. ; // CURLOPT_SSH_PUBLIC_KEYFILE - The file name for your public key. If not used, libcurl defaults to $HOME/.ssh/id_dsa.pub if the HOME environment variable is set, and just "id_dsa.pub" in the current directory if HOME is not set. ; Added in cURL 7.16.1. // CURLOPT_SSH_PRIVATE_KEYFILE - The file name for your private key. If not used, libcurl defaults to $HOME/.ssh/id_dsa if the HOME environment variable is set, and just "id_dsa" in the current directory if HOME is not set. If the file is password-protected, set the password with CURLOPT_KEYPASSWD. ; Added in cURL 7.16.1. // CURLOPT_SSL_CIPHER_LIST - A list of ciphers to use for SSL. For example, RC4-SHA and TLSv1 are valid cipher lists. ; // CURLOPT_SSL_EC_CURVES - A colon delimited list of elliptic curve algorithms. For example, X25519:P-521 is a valid list of two elliptic curves. This option defines the client's key exchange algorithms in the SSL handshake, if the SSL backend cURL is built to use supports it. ; // CURLOPT_SSLCERT - The name of a file containing a PEM formatted certificate. ; // CURLOPT_SSLCERTPASSWD - The password required to use the CURLOPT_SSLCERT certificate. ; // CURLOPT_SSLCERTTYPE - The format of the certificate. Supported formats are "PEM" (default), "DER", and "ENG". As of OpenSSL 0.9.3, "P12" (for PKCS#12-encoded files) is also supported. ; Added in cURL 7.9.3. // CURLOPT_SSLENGINE - The identifier for the crypto engine of the private SSL key specified in CURLOPT_SSLKEY. ; // CURLOPT_SSLENGINE_DEFAULT - The identifier for the crypto engine used for asymmetric crypto operations. ; // CURLOPT_SSLKEY - The name of a file containing a private SSL key. ; // CURLOPT_SSLKEYPASSWD - The secret password needed to use the private SSL key specified in CURLOPT_SSLKEY. // Note: Since this option contains a sensitive password, remember to keep the PHP script it is contained within safe. // ; // CURLOPT_SSLKEYTYPE - The key type of the private SSL key specified in CURLOPT_SSLKEY. Supported key types are "PEM" (default), "DER", and "ENG". ; // CURLOPT_TLS13_CIPHERS - The list of cipher suites to use for the TLS 1.3 connection. The list must be syntactically correct, it consists of one or more cipher suite strings separated by colons. This option is currently used only when curl is built to use OpenSSL 1.1.1 or later. If you are using a different SSL backend you can try setting TLS 1.3 cipher suites by using the CURLOPT_SSL_CIPHER_LIST option. ; Available since PHP 7.3.0 and libcurl >= cURL 7.61.0. Available when built with OpenSSL >= 1.1.1. // CURLOPT_UNIX_SOCKET_PATH - Enables the use of Unix domain sockets as connection endpoint and sets the path to the given string. ; Added in cURL 7.40.0. Available since PHP 7.0.7. // CURLOPT_URL - The URL to fetch. This can also be set when initializing a session with curl_init(). ; // CURLOPT_USERAGENT - The contents of the "User-Agent: " header to be used in a HTTP request. ; // CURLOPT_USERNAME - The user name to use in authentication. ; Added in cURL 7.19.1. // CURLOPT_PASSWORD - The password to use in authentication. ; Added in cURL 7.19.1. // CURLOPT_USERPWD - A username and password formatted as "[username]:[password]" to use for the connection. ; // CURLOPT_XOAUTH2_BEARER - Specifies the OAuth 2.0 access token. ; Added in cURL 7.33.0. Available since PHP 7.0.7. // // value should be an array for the following values of the option parameter: // Option - Set value to ; Notes // CURLOPT_CONNECT_TO - Connect to a specific host and port instead of the URL's host and port. Accepts an array of strings with the format HOST:PORT:CONNECT-TO-HOST:CONNECT-TO-PORT. ; Added in cURL 7.49.0. Available since PHP 7.0.7. // CURLOPT_HTTP200ALIASES - An array of HTTP 200 responses that will be treated as valid responses and not as errors. ; Added in cURL 7.10.3. // CURLOPT_HTTPHEADER - An array of HTTP header fields to set, in the format array('Content-type: text/plain', 'Content-length: 100') ; // CURLOPT_POSTQUOTE - An array of FTP commands to execute on the server after the FTP request has been performed. ; // CURLOPT_PROXYHEADER - An array of custom HTTP headers to pass to proxies. ; Added in cURL 7.37.0. Available since PHP 7.0.7. // CURLOPT_QUOTE - An array of FTP commands to execute on the server prior to the FTP request. ; // CURLOPT_RESOLVE - Provide a custom address for a specific host and port pair. An array of hostname, port, and IP address strings, each element separated by a colon. In the format: array("example.com:80:127.0.0.1") ; Added in cURL 7.21.3. // value should be a stream resource (using fopen(), for example) for the following values of the option parameter: // Option - Set value to // CURLOPT_FILE - The file that the transfer should be written to. The default is STDOUT (the browser window). // CURLOPT_INFILE - The file that the transfer should be read from when uploading. // CURLOPT_STDERR - An alternative location to output errors to instead of STDERR. // CURLOPT_WRITEHEADER - The file that the header part of the transfer is written to. // // value should be the name of a valid function or a Closure for the following values of the option parameter: // Option - Set value to ; Notes // CURLOPT_HEADERFUNCTION - A callback accepting two parameters. The first is the cURL resource, the second is a string with the header data to be written. The header data must be written by this callback. Return the number of bytes written. ; // CURLOPT_PASSWDFUNCTION - A callback accepting three parameters. The first is the cURL resource, the second is a string containing a password prompt, and the third is the maximum password length. Return the string containing the password. ; Removed as of PHP 7.3.0. // CURLOPT_PROGRESSFUNCTION - A callback accepting five parameters. The first is the cURL resource, the second is the total number of bytes expected to be downloaded in this transfer, the third is the number of bytes downloaded so far, the fourth is the total number of bytes expected to be uploaded in this transfer, and the fifth is the number of bytes uploaded so far. // Note: The callback is only called when the CURLOPT_NOPROGRESS option is set to false. // Return a non-zero value to abort the transfer. In which case, the transfer will set a CURLE_ABORTED_BY_CALLBACK error. // ; Return a non-zero value to abort the transfer. In which case, the transfer will set a CURLE_ABORTED_BY_CALLBACK error. // CURLOPT_READFUNCTION - A callback accepting three parameters. The first is the cURL resource, the second is a stream resource provided to cURL through the option CURLOPT_INFILE, and the third is the maximum amount of data to be read. The callback must return a string with a length equal or smaller than the amount of data requested, typically by reading it from the passed stream resource. It should return an empty string to signal EOF. ; // CURLOPT_WRITEFUNCTION - A callback accepting two parameters. The first is the cURL resource, and the second is a string with the data to be written. The data must be saved by this callback. It must return the exact number of bytes written or the transfer will be aborted with an error. ; // CURLOPT_XFERINFOFUNCTION - A callback accepting two parameters. Has a similar purpose as CURLOPT_PROGRESSFUNCTION but is more modern and the preferred option from cURL. ; Added in 7.32.0. Available as of PHP 8.2.0. // // Other values: // Option - Set value to // CURLOPT_SHARE - A result of curl_share_init(). Makes the cURL handle to use the data from the shared handle. ); // Return Values // Returns true on success or false on failure. // // Changelog // Version - Description // 8.0.0 - handle expects a CurlHandle instance now; previously, a resource was expected. // 7.3.15, 7.4.3 - Introduced CURLOPT_HTTP09_ALLOWED. // 7.3.0 - Introduced CURLOPT_ABSTRACT_UNIX_SOCKET, CURLOPT_KEEP_SENDING_ON_ERROR, CURLOPT_PRE_PROXY, CURLOPT_PROXY_CAINFO, CURLOPT_PROXY_CAPATH, CURLOPT_PROXY_CRLFILE, CURLOPT_PROXY_KEYPASSWD, CURLOPT_PROXY_PINNEDPUBLICKEY, CURLOPT_PROXY_SSLCERT, CURLOPT_PROXY_SSLCERTTYPE, CURLOPT_PROXY_SSL_CIPHER_LIST, CURLOPT_PROXY_SSLKEY, CURLOPT_PROXY_SSLKEYTYPE, CURLOPT_PROXY_SSL_OPTIONS, CURLOPT_PROXY_SSL_VERIFYHOST, CURLOPT_PROXY_SSL_VERIFYPEER, CURLOPT_PROXY_SSLVERSION, CURLOPT_PROXY_TLSAUTH_PASSWORD, CURLOPT_PROXY_TLSAUTH_TYPE, CURLOPT_PROXY_TLSAUTH_USERNAME, CURLOPT_SOCKS5_AUTH, CURLOPT_SUPPRESS_CONNECT_HEADERS, CURLOPT_DISALLOW_USERNAME_IN_URL, CURLOPT_DNS_SHUFFLE_ADDRESSES, CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS, CURLOPT_HAPROXYPROTOCOL, CURLOPT_PROXY_TLS13_CIPHERS, CURLOPT_SSH_COMPRESSION, CURLOPT_TIMEVALUE_LARGE and CURLOPT_TLS13_CIPHERS. // 7.0.7 - Introduced CURL_HTTP_VERSION_2, CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE, CURL_HTTP_VERSION_2TLS, CURL_REDIR_POST_301, CURL_REDIR_POST_302, CURL_REDIR_POST_303, CURL_REDIR_POST_ALL, CURL_VERSION_KERBEROS5, CURL_VERSION_PSL, CURL_VERSION_UNIX_SOCKETS, CURLAUTH_NEGOTIATE, CURLAUTH_NTLM_WB, CURLFTP_CREATE_DIR, CURLFTP_CREATE_DIR_NONE, CURLFTP_CREATE_DIR_RETRY, CURLHEADER_SEPARATE, CURLHEADER_UNIFIED, CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE, CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE, CURLMOPT_MAX_HOST_CONNECTIONS, CURLMOPT_MAX_PIPELINE_LENGTH, CURLMOPT_MAX_TOTAL_CONNECTIONS, CURLOPT_CONNECT_TO, CURLOPT_DEFAULT_PROTOCOL, CURLOPT_DNS_INTERFACE, CURLOPT_DNS_LOCAL_IP4, CURLOPT_DNS_LOCAL_IP6, CURLOPT_EXPECT_100_TIMEOUT_MS, CURLOPT_HEADEROPT, CURLOPT_LOGIN_OPTIONS, CURLOPT_PATH_AS_IS, CURLOPT_PINNEDPUBLICKEY, CURLOPT_PIPEWAIT, CURLOPT_PROXY_SERVICE_NAME, CURLOPT_PROXYHEADER, CURLOPT_SASL_IR, CURLOPT_SERVICE_NAME, CURLOPT_SSL_ENABLE_ALPN, CURLOPT_SSL_ENABLE_NPN, CURLOPT_SSL_FALSESTART, CURLOPT_SSL_VERIFYSTATUS, CURLOPT_STREAM_WEIGHT, CURLOPT_TCP_FASTOPEN, CURLOPT_TFTP_NO_OPTIONS, CURLOPT_UNIX_SOCKET_PATH, CURLOPT_XOAUTH2_BEARER, CURLPROTO_SMB, CURLPROTO_SMBS, CURLPROXY_HTTP_1_0, CURLSSH_AUTH_AGENT and CURLSSLOPT_NO_REVOKE. // // [examples] // Examples // [example] // Example #1 Initializing a new cURL session and fetching a web page // [php] // // create a new cURL resource // $ch = curl_init(); // // // set URL and other appropriate options // curl_setopt($ch, CURLOPT_URL, "http://www.example.com/"); // curl_setopt($ch, CURLOPT_HEADER, false); // // // grab URL and pass it to the browser // curl_exec($ch); // // // close cURL resource, and free up system resources // curl_close($ch); // [/php] // [/example] // [/examples] // // Notes // Note: Passing an array to CURLOPT_POSTFIELDS will encode the data as multipart/form-data, while passing a URL-encoded string will encode the data as application/x-www-form-urlencoded. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-07) // URL: https://www.php.net/manual/en/function.curl-setopt.php // ========== CURL_SETOPT - END // SYNTAX: // bool curl_setopt(CurlHandle $handle, int $option, mixed $value) return $return_curl_setopt; // bool } // ============================== END // PHP_OTHER_CURL_CURL_SETOPT // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_SHARE_CLOSE // ============================== OFFLINE // ============================== ABOUT // Close a cURL share handle. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_share_close() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curl_share_close($share_handle) { // ========== CURL_SHARE_CLOSE - BEGIN // ===== ABOUT // Close a cURL share handle // ===== DESCRIPTION // Note: This function has no effect. Prior to PHP 8.0.0, this function was used to close the resource. // Closes a cURL share handle and frees all resources. // ===== SUPPORTED // PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ===== SYNTAX // curl_share_close(CurlShareHandle $share_handle): void // ===== CODE curl_share_close( $share_handle // CurlShareHandle share_handle - A cURL share handle returned by curl_share_init(). ); // Return Values // No value is returned. // // Changelog // Version - Description // 8.0.0 - share_handle expects a CurlShareHandle instance now; previously, a resource was expected. // // [examples] // Examples // [example] // Example #1 curl_share_setopt() example // This example will create a cURL share handle, add two cURL handles to it, and then run them with cookie data sharing. // [php] // // Create cURL share handle and set it to share cookie data // $sh = curl_share_init(); // curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE); // // // Initialize the first cURL handle and assign the share handle to it // $ch1 = curl_init("http://example.com/"); // curl_setopt($ch1, CURLOPT_SHARE, $sh); // // // Execute the first cURL handle // curl_exec($ch1); // // // Initialize the second cURL handle and assign the share handle to it // $ch2 = curl_init("http://php.net/"); // curl_setopt($ch2, CURLOPT_SHARE, $sh); // // // Execute the second cURL handle // // all cookies from $ch1 handle are shared with $ch2 handle // curl_exec($ch2); // // // Close the cURL share handle // curl_share_close($sh); // // // Close the cURL handles // curl_close($ch1); // curl_close($ch2); // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-07) // URL: https://www.php.net/manual/en/function.curl-share-close.php // ========== CURL_SHARE_CLOSE - END // SYNTAX: // void curl_share_close(CurlShareHandle $share_handle) // Return: void } */ // ============================== END // PHP_OTHER_CURL_CURL_SHARE_CLOSE // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_SHARE_ERRNO // ============================== OFFLINE // ============================== ABOUT // Return the last share curl error number. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_share_errno() - PHP_7 >= PHP_7_1_0, PHP_8 // ============================== CODE /* function php_other_curl_curl_share_errno($share_handle) { $return_curl_share_errno = 0; // ========== CURL_SHARE_ERRNO - BEGIN // ===== ABOUT // Return the last share curl error number // ===== DESCRIPTION // Return an integer containing the last share curl error number. // ===== SUPPORTED // PHP_7 >= PHP_7_1_0, PHP_8 // ===== SYNTAX // curl_share_errno(CurlShareHandle $share_handle): int // ===== CODE $return_curl_share_errno = curl_share_errno( $share_handle // CurlShareHandle share_handle - A cURL share handle returned by curl_share_init(). ); // Return Values // Returns an integer containing the last share curl error number. // // Changelog // Version - Description // 8.0.0 - The function no longer returns false on failure. // 8.0.0 - share_handle expects a CurlShareHandle instance now; previously, a resource was expected. // ===== LITERATURE_SOURCES // * PHP_NET (2023-09-22) // URL: https://www.php.net/manual/en/function.curl-share-errno.php // ========== CURL_SHARE_ERRNO - END // SYNTAX: // int curl_share_errno(CurlShareHandle $share_handle) return $return_curl_share_errno; // int } */ // ============================== END // PHP_OTHER_CURL_CURL_SHARE_ERRNO // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_SHARE_INIT // ============================== OFFLINE // ============================== ABOUT // Initialize a cURL share handle. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_share_init() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curl_share_init() { $return_curl_share_init = null; // ========== CURL_SHARE_INIT - BEGIN // ===== ABOUT // Initialize a cURL share handle // ===== DESCRIPTION // Allows to share data between cURL handles. // ===== SUPPORTED // PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ===== SYNTAX // curl_share_init(): CurlShareHandle // ===== CODE $return_curl_share_init = curl_share_init( // This function has no parameters. ); // Return Values // Returns a cURL share handle. // // Changelog // Version - Description // 8.0.0 - This function returns a CurlShareHandle instance now; previously, a resource was returned. // // [examples] // Examples // [example] // Example #1 curl_share_init() example // This example will create a cURL share handle, add two cURL handles to it, and then run them with cookie data sharing. // [php] // // Create cURL share handle and set it to share cookie data // $sh = curl_share_init(); // curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE); // // // Initialize the first cURL handle and assign the share handle to it // $ch1 = curl_init("http://example.com/"); // curl_setopt($ch1, CURLOPT_SHARE, $sh); // // // Execute the first cURL handle // curl_exec($ch1); // // // Initialize the second cURL handle and assign the share handle to it // $ch2 = curl_init("http://php.net/"); // curl_setopt($ch2, CURLOPT_SHARE, $sh); // // // Execute the second cURL handle // // all cookies from $ch1 handle are shared with $ch2 handle // curl_exec($ch2); // // // Close the cURL share handle // curl_share_close($sh); // // // Close the cURL handles // curl_close($ch1); // curl_close($ch2); // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-07) // URL: https://www.php.net/manual/en/function.curl-share-init.php // ========== CURL_SHARE_INIT - END // SYNTAX: // CurlShareHandle curl_share_init() return $return_curl_share_init; // CurlShareHandle } */ // ============================== END // PHP_OTHER_CURL_CURL_SHARE_INIT // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_SHARE_SETOPT // ============================== OFFLINE // ============================== ABOUT // Set an option for a cURL share handle. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_share_setopt() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curl_share_setopt($share_handle, $option, $value) { $return_curl_share_setopt = false; // ========== CURL_SHARE_SETOPT - BEGIN // ===== ABOUT // Set an option for a cURL share handle // ===== DESCRIPTION // Sets an option on the given cURL share handle. // ===== SUPPORTED // PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ===== SYNTAX // curl_share_setopt(CurlShareHandle $share_handle, int $option, mixed $value): bool // ===== CODE $return_curl_share_setopt = curl_share_setopt( $share_handle, // CurlShareHandle share_handle - A cURL share handle returned by curl_share_init(). $option, // int option - // Option - Description // CURLSHOPT_SHARE - Specifies a type of data that should be shared. // CURLSHOPT_UNSHARE - Specifies a type of data that will be no longer shared. $value // mixed value - // Value - Description // CURL_LOCK_DATA_COOKIE - Shares cookie data. // CURL_LOCK_DATA_DNS - Shares DNS cache. Note that when you use cURL multi handles, all handles added to the same multi handle will share DNS cache by default. // CURL_LOCK_DATA_SSL_SESSION - Shares SSL session IDs, reducing the time spent on the SSL handshake when reconnecting to the same server. Note that SSL session IDs are reused within the same handle by default. ); // Return Values // Returns true on success or false on failure. // // Changelog // Version - Description // 8.0.0 - share_handle expects a CurlShareHandle instance now; previously, a resource was expected. // // [examples] // Examples // [example] // Example #1 curl_share_setopt() example // This example will create a cURL share handle, add two cURL handles to it, and then run them with cookie data sharing. // [php] // // Create cURL share handle and set it to share cookie data // $sh = curl_share_init(); // curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE); // // // Initialize the first cURL handle and assign the share handle to it // $ch1 = curl_init("http://example.com/"); // curl_setopt($ch1, CURLOPT_SHARE, $sh); // // // Execute the first cURL handle // curl_exec($ch1); // // // Initialize the second cURL handle and assign the share handle to it // $ch2 = curl_init("http://php.net/"); // curl_setopt($ch2, CURLOPT_SHARE, $sh); // // // Execute the second cURL handle // // all cookies from $ch1 handle are shared with $ch2 handle // curl_exec($ch2); // // // Close the cURL share handle // curl_share_close($sh); // // // Close the cURL handles // curl_close($ch1); // curl_close($ch2); // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-07) // URL: https://www.php.net/manual/en/function.curl-share-setopt.php // ========== CURL_SHARE_SETOPT - END // SYNTAX: // bool curl_share_setopt(CurlShareHandle $share_handle, int $option, mixed $value) return $return_curl_share_setopt; // bool } */ // ============================== END // PHP_OTHER_CURL_CURL_SHARE_SETOPT // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_SHARE_STRERROR // ============================== OFFLINE // ============================== ABOUT // Return string describing the given error code. // ============================== SUPPORT // PHP_7 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_share_strerror() - PHP_7 >= PHP_7_1_0, PHP_8 // ============================== CODE /* function php_other_curl_curl_share_strerror($error_code) { $return_curl_share_strerror = null; // ========== CURL_SHARE_STRERROR - BEGIN // ===== ABOUT // Return string describing the given error code // ===== DESCRIPTION // Returns a text error message describing the given error code. // ===== SUPPORTED // PHP_7 >= PHP_7_1_0, PHP_8 // ===== SYNTAX // curl_share_strerror(int $error_code): ?string // ===== CODE $return_curl_share_strerror = curl_share_strerror( $error_code // int error_code - One of the > cURL error codes constants. ); // Return Values // Returns error description or null for invalid error code. // ===== LITERATURE_SOURCES // * PHP_NET (2023-09-22) // URL: https://www.php.net/manual/en/function.curl-share-strerror.php // ========== CURL_SHARE_STRERROR - END // SYNTAX: // string curl_share_strerror(int $error_code) return $return_curl_share_strerror; // string } */ // ============================== END // PHP_OTHER_CURL_CURL_SHARE_STRERROR // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_STRERROR // ============================== OFFLINE // ============================== ABOUT // Return string describing the given error code. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_strerror() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curl_strerror($error_code) { $return_curl_strerror = null; // ========== CURL_STRERROR - BEGIN // ===== ABOUT // Return string describing the given error code // ===== DESCRIPTION // Returns a text error message describing the given error code. // ===== SUPPORTED // PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ===== SYNTAX // curl_strerror(int $error_code): ?string // ===== CODE $return_curl_strerror = curl_strerror( $error_code // int error_code - One of the > cURL error codes constants. ); // Return Values // Returns error description or null for invalid error code. // // [examples] // Examples // [example] // Example #1 curl_errno() example // [php] // // Create a curl handle with a misspelled protocol in URL // $ch = curl_init("htp://example.com/"); // // // Send request // curl_exec($ch); // // // Check for errors and display the error message // if($errno = curl_errno($ch)) { // $error_message = curl_strerror($errno); // echo "cURL error ({$errno}):\n {$error_message}"; // } // // // Close the handle // curl_close($ch); // [/php] // The above example will output: // [result] // cURL error (1): // Unsupported protocol // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-06) // URL: https://www.php.net/manual/en/function.curl-strerror.php // ========== CURL_STRERROR - END // SYNTAX: // string curl_strerror(int $error_code) return $return_curl_strerror; // string } */ // ============================== END // PHP_OTHER_CURL_CURL_STRERROR // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_UNESCAPE // ============================== OFFLINE // ============================== ABOUT // Decodes the given URL encoded string. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_unescape() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curl_unescape($handle, $string) { $return_curl_unescape = false; // ========== CURL_UNESCAPE - BEGIN // ===== ABOUT // Decodes the given URL encoded string // ===== DESCRIPTION // This function decodes the given URL encoded string. // ===== SUPPORTED // PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ===== SYNTAX // curl_unescape(CurlHandle $handle, string $string): string|false // ===== CODE $return_curl_unescape = curl_unescape( $handle, // CurlHandle handle - A cURL handle returned by curl_init(). $string // string string - The URL encoded string to be decoded. ); // Return Values // Returns decoded string or false on failure. // // Changelog // Version - Description // 8.0.0 - handle expects a CurlHandle instance now; previously, a resource was expected. // // [examples] // Examples // [example] // Example #1 curl_escape() example // [php] // // Create a curl handle // $ch = curl_init('http://example.com/redirect.php'); // // // Send HTTP request and follow redirections // curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // curl_exec($ch); // // // Get the last effective URL // $effective_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); // // ie. "http://example.com/show_location.php?loc=M%C3%BCnchen" // // // Decode the URL // $effective_url_decoded = curl_unescape($ch, $effective_url); // // "http://example.com/show_location.php?loc=München" // // // Close the handle // curl_close($ch); // [/php] // [/example] // [/examples] // // Notes // Note: curl_unescape() does not decode plus symbols (+) into spaces. urldecode() does. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-06) // URL: https://www.php.net/manual/en/function.curl-unescape.php // ========== CURL_UNESCAPE - END // SYNTAX: // string|false curl_unescape(CurlHandle $handle, string $string) return $return_curl_unescape; // string|false } */ // ============================== END // PHP_OTHER_CURL_CURL_UNESCAPE // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_UPKEEP // ============================== OFFLINE // ============================== ABOUT // Performs any connection upkeep checks. // ============================== SUPPORT // PHP_8 // ============================== USING FUNCTIONS (1) // curl_upkeep() - PHP_8 >= PHP_8_2_0 // ============================== CODE /* function php_other_curl_curl_upkeep($handle) { $return_curl_upkeep = false; // ========== CURL_UPKEEP - BEGIN // ===== ABOUT // Performs any connection upkeep checks // ===== DESCRIPTION // Available if built against libcurl >= 7.62.0. // Some protocols have "connection upkeep" mechanisms. These mechanisms usually send some traffic on existing connections in order to keep them alive; this can prevent connections from being closed due to overzealous firewalls, for example. // Connection upkeep is currently available only for HTTP/2 connections. A small amount of traffic is usually sent to keep a connection alive. HTTP/2 maintains its connection by sending a HTTP/2 PING frame. // ===== SUPPORTED // PHP_8 >= PHP_8_2_0 // ===== SYNTAX // curl_upkeep(CurlHandle $handle): bool // ===== CODE $return_curl_upkeep = curl_upkeep( $handle // CurlHandle handle - A cURL handle returned by curl_init(). ); // Return Values // Returns true on success or false on failure. // // [examples] // Examples // [example] // Example #1 curl_upkeep() example // [php] // $url = "https://example.com"; // // $ch = curl_init(); // curl_setopt($ch, CURLOPT_URL, $url); // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // curl_setopt($ch, CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_2_0); // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // curl_setopt($ch, CURLOPT_UPKEEP_INTERVAL_MS, 200); // if (curl_exec($ch)) { // usleep(300); // var_dump(curl_upkeep($ch)); // } // curl_close($ch); // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-07) // URL: https://www.php.net/manual/en/function.curl_upkeep.php // ========== CURL_UPKEEP - END // SYNTAX: // bool curl_upkeep(CurlHandle $handle) return $return_curl_upkeep; // bool } */ // ============================== END // PHP_OTHER_CURL_CURL_UPKEEP // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURL_VERSION // ============================== PUBLIC // ============================== ABOUT // Gets cURL version information. // ============================== SUPPORT // PHP_4 - PHP_8 // ============================== USING FUNCTIONS (1) // curl_version() - PHP_4 >= PHP_4_0_2, PHP_5, PHP_7, PHP_8 // ============================== CODE function php_other_curl_curl_version() { $return_curl_version = false; // ========== CURL_VERSION - BEGIN // ===== ABOUT // Gets cURL version information // ===== DESCRIPTION // Returns information about the cURL version. // ===== SUPPORTED // PHP_4 >= PHP_4_0_2, PHP_5, PHP_7, PHP_8 // ===== SYNTAX // curl_version(): array|false // ===== CODE $return_curl_version = curl_version( // This function has no parameters. ); // Return Values // Returns an associative array with the following elements: // Key - Value description // version_number - cURL 24 bit version number // version - cURL version number, as a string // ssl_version_number - OpenSSL 24 bit version number // ssl_version - OpenSSL version number, as a string // libz_version - zlib version number, as a string // host - Information about the host where cURL was built // age - // features - A bitmask of the CURL_VERSION_XXX constants // protocols - An array of protocols names supported by cURL // // Changelog // Version - Description // 8.0.0 - The optional age parameter has been removed. // 7.4.0 - The optional age parameter has been deprecated; if a value is passed, it is ignored. // // [examples] // Examples // [example] // Example #1 curl_version() example // This example will check which features that's available in cURL build by using the 'features' bitmask returned by curl_version(). // [php] // // Get curl version array // $version = curl_version(); // // // These are the bitfields that can be used // // to check for features in the curl build // $bitfields = Array( // 'CURL_VERSION_IPV6', // 'CURL_VERSION_KERBEROS4', // 'CURL_VERSION_SSL', // 'CURL_VERSION_LIBZ' // ); // // // foreach($bitfields as $feature) // { // echo $feature . ($version['features'] & constant($feature) ? ' matches' : ' does not match'); // echo PHP_EOL; // } // [/php] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-07) // URL: https://www.php.net/manual/en/function.curl-version.php // ========== CURL_VERSION - END // SYNTAX: // array|false curl_version() return $return_curl_version; // array|false } // ============================== END // PHP_OTHER_CURL_CURL_VERSION // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURLFILE // ============================== OFFLINE // OFFLINE | PHP_OTHER_CURL_CURLFILE_CONSTRUCT - CURLFile php_other_curl_curlfile_construct(string $filename, string $mime_type = null, string $posted_filename = null) // OFFLINE | PHP_OTHER_CURL_CURLFILE_GETFILENAME - string php_other_curl_curlfile_getfilename(CURLFile $curlfile) // OFFLINE | PHP_OTHER_CURL_CURLFILE_GETMIMETYPE - string php_other_curl_curlfile_getmimetype(CURLFile $curlfile) // OFFLINE | PHP_OTHER_CURL_CURLFILE_GETPOSTFILENAME - string php_other_curl_curlfile_getpostfilename(CURLFile $curlfile) // OFFLINE | PHP_OTHER_CURL_CURLFILE_SETMIMETYPE - void php_other_curl_curlfile_setmimetype(CURLFile $curlfile, string $mime_type) // OFFLINE | PHP_OTHER_CURL_CURLFILE_SETPOSTFILENAME - void php_other_curl_curlfile_setpostfilename(CURLFile $curlfile, string $posted_filename) // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (6) // OFFLINE | CURLFile::__construct() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // OFFLINE | CURLFile::getFilename() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // OFFLINE | CURLFile::getMimeType() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // OFFLINE | CURLFile::getPostFilename() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // OFFLINE | CURLFile::setMimeType() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // OFFLINE | CURLFile::setPostFilename() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ============================== USING DATA_TYPES (3) // OFFLINE | CURLFile - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // string // void // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURLFILE_CONSTRUCT // ============================== OFFLINE // ============================== ABOUT // Create a CURLFile object. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CURLFile::__construct() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curlfile_construct($filename, $mime_type = null, $posted_filename = null) { $return_curlfile_construct = null; // ========== CURLFILE_CONSTRUCT - BEGIN // ===== ABOUT // Create a CURLFile object // ===== DESCRIPTION // Creates a CURLFile object, used to upload a file with CURLOPT_POSTFIELDS. // ===== SUPPORTED // PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ===== SYNTAX // Object-oriented style // public CURLFile::__construct(string $filename, ?string $mime_type = null, ?string $posted_filename = null) // // Procedural style // curl_file_create(string $filename, ?string $mime_type = null, ?string $posted_filename = null): CURLFile // ===== CODE $return_curlfile_construct = new CURLFile( $filename, // string filename - Path to the file which will be uploaded. $mime_type, // string mime_type - Mimetype of the file. $posted_filename // string posted_filename - Name of the file to be used in the upload data. ); // Return Values // Returns a CURLFile object. // // Changelog // Version - Description // 8.0.0 - mime_type and posted_filename are nullable now; previously their default was 0. // // [examples] // Examples // [example] // Example #1 CURLFile::__construct() example // Object-oriented style // [php] // // http://example.com/upload.php: // // < ?php var_dump($_FILES); ? > // // // // // Create a cURL handle // $ch = curl_init('http://example.com/upload.php'); // // // Create a CURLFile object // $cfile = new CURLFile('cats.jpg','image/jpeg','test_name'); // // // Assign POST data // $data = array('test_file' => $cfile); // curl_setopt($ch, CURLOPT_POST,1); // curl_setopt($ch, CURLOPT_POSTFIELDS, $data); // // // Execute the handle // curl_exec($ch); // [/php] // Procedural style // [php] // // http://example.com/upload.php: // // < ?php var_dump($_FILES); ? > // // // // // Create a cURL handle // $ch = curl_init('http://example.com/upload.php'); // // // Create a CURLFile object // $cfile = curl_file_create('cats.jpg','image/jpeg','test_name'); // // // Assign POST data // $data = array('test_file' => $cfile); // curl_setopt($ch, CURLOPT_POST,1); // curl_setopt($ch, CURLOPT_POSTFIELDS, $data); // // // Execute the handle // curl_exec($ch); // [/php] // The above example will output: // [result] // array(1) { // ["test_file"]=> // array(5) { // ["name"]=> // string(9) "test_name" // ["type"]=> // string(10) "image/jpeg" // ["tmp_name"]=> // string(14) "/tmp/phpPC9Kbx" // ["error"]=> // int(0) // ["size"]=> // int(46334) // } // } // [/result] // [/example] // [example] // Example #2 CURLFile::__construct() uploading multiple files example // Object-oriented style // [php] // $request = curl_init('http://www.example.com/upload.php'); // curl_setopt($request, CURLOPT_POST, true); // curl_setopt($request, CURLOPT_SAFE_UPLOAD, true); // curl_setopt($request, CURLOPT_POSTFIELDS, [ // 'blob[0]' => new CURLFile(realpath('first-file.jpg'), 'image/jpeg'), // 'blob[1]' => new CURLFile(realpath('second-file.txt'), 'text/plain'), // 'blob[2]' => new CURLFile(realpath('third-file.exe'), 'application/octet-stream'), // ]); // curl_setopt($request, CURLOPT_RETURNTRANSFER, true); // // echo curl_exec($request); // // var_dump(curl_getinfo($request)); // // curl_close($request); // [/php] // Procedural style // [php] // // procedural // $request = curl_init('http://www.example.com/upload.php'); // curl_setopt($request, CURLOPT_POST, true); // curl_setopt($request, CURLOPT_SAFE_UPLOAD, true); // curl_setopt($request, CURLOPT_POSTFIELDS, [ // 'blob[0]' => curl_file_create(realpath('first-file.jpg'), 'image/jpeg'), // 'blob[1]' => curl_file_create(realpath('second-file.txt'), 'text/plain'), // 'blob[2]' => curl_file_create(realpath('third-file.exe'), 'application/octet-stream'), // ]); // curl_setopt($request, CURLOPT_RETURNTRANSFER, true); // // echo curl_exec($request); // // var_dump(curl_getinfo($request)); // // curl_close($request); // [/php] // The above example will output: // [result] // array(26) { // ["url"]=> // string(31) "http://www.example.com/upload.php" // ["content_type"]=> // string(24) "text/html; charset=UTF-8" // ["http_code"]=> // int(200) // ["header_size"]=> // int(198) // ["request_size"]=> // int(196) // ["filetime"]=> // int(-1) // ["ssl_verify_result"]=> // int(0) // ["redirect_count"]=> // int(0) // ["total_time"]=> // float(0.060062) // ["namelookup_time"]=> // float(0.028575) // ["connect_time"]=> // float(0.029011) // ["pretransfer_time"]=> // float(0.029121) // ["size_upload"]=> // float(3230730) // ["size_download"]=> // float(811) // ["speed_download"]=> // float(13516) // ["speed_upload"]=> // float(53845500) // ["download_content_length"]=> // float(811) // ["upload_content_length"]=> // float(3230730) // ["starttransfer_time"]=> // float(0.030355) // ["redirect_time"]=> // float(0) // ["redirect_url"]=> // string(0) "" // ["primary_ip"]=> // string(13) "0.0.0.0" // ["certinfo"]=> // array(0) { // } // ["primary_port"]=> // int(80) // ["local_ip"]=> // string(12) "0.0.0.0" // ["local_port"]=> // int(34856) // } // [/result] // [/example] // [/examples] // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-07) // URL: https://www.php.net/manual/en/curlfile.construct.php // ========== CURLFILE_CONSTRUCT - END // SYNTAX: // CURLFile CURLFile::__construct(string $filename, string $mime_type = null, string $posted_filename = null) return $return_curlfile_construct; // CURLFile } */ // ============================== END // PHP_OTHER_CURL_CURLFILE_CONSTRUCT // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURLFILE_GETFILENAME // ============================== OFFLINE // ============================== ABOUT // Get file name. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CURLFile::getFilename() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curlfile_getfilename($curlfile) { $return_curlfile_getfilename = null; // ========== CURLFILE_GETFILENAME - BEGIN // ===== ABOUT // Get file name // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ===== SYNTAX // public CURLFile::getFilename(): string // ===== CODE $return_curlfile_getfilename = $curlfile->getFilename( // This function has no parameters. ); // Return Values // Returns file name. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-07) // URL: https://www.php.net/manual/en/curlfile.getfilename.php // ========== CURLFILE_GETFILENAME - END // SYNTAX: // string CURLFile::getFilename() return $return_curlfile_getfilename; // string } */ // ============================== END // PHP_OTHER_CURL_CURLFILE_GETFILENAME // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURLFILE_GETMIMETYPE // ============================== OFFLINE // ============================== ABOUT // Get MIME type. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CURLFile::getMimeType() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curlfile_getmimetype($curlfile) { $return_curlfile_getmimetype = null; // ========== CURLFILE_GETMIMETYPE - BEGIN // ===== ABOUT // Get MIME type // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ===== SYNTAX // public CURLFile::getMimeType(): string // ===== CODE $return_curlfile_getmimetype = $curlfile->getMimeType( // This function has no parameters. ); // Return Values // Returns MIME type. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-08) // URL: https://www.php.net/manual/en/curlfile.getmimetype.php // ========== CURLFILE_GETMIMETYPE - END // SYNTAX: // string CURLFile::getMimeType() return $return_curlfile_getmimetype; // string } */ // ============================== END // PHP_OTHER_CURL_CURLFILE_GETMIMETYPE // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURLFILE_GETPOSTFILENAME // ============================== OFFLINE // ============================== ABOUT // Get file name for POST. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CURLFile::getPostFilename() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curlfile_getpostfilename($curlfile) { $return_curlfile_getpostfilename = null; // ========== CURLFILE_GETPOSTFILENAME - BEGIN // ===== ABOUT // Get file name for POST // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ===== SYNTAX // public CURLFile::getPostFilename(): string // ===== CODE $return_curlfile_getpostfilename = $curlfile->getPostFilename( // This function has no parameters. ); // Return Values // Returns file name for POST. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-08) // URL: https://www.php.net/manual/en/curlfile.getpostfilename.php // ========== CURLFILE_GETPOSTFILENAME - END // SYNTAX: // string CURLFile::getPostFilename() return $return_curlfile_getpostfilename; // string } */ // ============================== END // PHP_OTHER_CURL_CURLFILE_GETPOSTFILENAME // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURLFILE_SETMIMETYPE // ============================== OFFLINE // ============================== ABOUT // Set MIME type. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CURLFile::setMimeType() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curlfile_setmimetype($curlfile, $mime_type) { // ========== CURLFILE_SETMIMETYPE - BEGIN // ===== ABOUT // Set MIME type // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ===== SYNTAX // public CURLFile::setMimeType(string $mime_type): void // ===== CODE $curlfile->setMimeType( $mime_type // string mime_type - MIME type to be used in POST data. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-08) // URL: https://www.php.net/manual/en/curlfile.setmimetype.php // ========== CURLFILE_SETMIMETYPE - END // SYNTAX: // void CURLFile::setMimeType(string $mime_type) // Return: void } */ // ============================== END // PHP_OTHER_CURL_CURLFILE_SETMIMETYPE // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURLFILE_SETPOSTFILENAME // ============================== OFFLINE // ============================== ABOUT // Set file name for POST. // ============================== SUPPORT // PHP_5 - PHP_8 // ============================== USING SUBCLASSES (1) // CURLFile::setPostFilename() - PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ============================== CODE /* function php_other_curl_curlfile_setpostfilename($curlfile, $posted_filename) { // ========== CURLFILE_SETPOSTFILENAME - BEGIN // ===== ABOUT // Set file name for POST // ===== DESCRIPTION // ===== SUPPORTED // PHP_5 >= PHP_5_5_0, PHP_7, PHP_8 // ===== SYNTAX // public CURLFile::setPostFilename(string $posted_filename): void // ===== CODE $curlfile->setPostFilename( $posted_filename // string posted_filename - Filename to be used in POST data. ); // Return Values // No value is returned. // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-08) // URL: https://www.php.net/manual/en/curlfile.setpostfilename.php // ========== CURLFILE_SETPOSTFILENAME - END // SYNTAX: // void CURLFile::setPostFilename(string $posted_filename) // Return: void } */ // ============================== END // PHP_OTHER_CURL_CURLFILE_SETPOSTFILENAME // ============================== // ============================== END // PHP_OTHER_CURL_CURLFILE // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURLSTRINGFILE // ============================== OFFLINE // OFFLINE | PHP_OTHER_CURL_CURLSTRINGFILE_CONSTRUCT - CURLStringFile php_other_curl_curlstringfile_construct(string $data, string $postname, string $mime = "application/octet-stream") // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // OFFLINE | CURLStringFile::__construct() - PHP_8 >= PHP_8_1_0 // ============================== USING DATA_TYPES (2) // OFFLINE | CURLStringFile - PHP_8 >= PHP_8_1_0 // string // ============================== // ============================== BEGIN // PHP_OTHER_CURL_CURLSTRINGFILE_CONSTRUCT // ============================== OFFLINE // ============================== ABOUT // Create a CURLStringFile object. // ============================== SUPPORT // PHP_8 // ============================== USING SUBCLASSES (1) // CURLStringFile::__construct() - PHP_8 >= PHP_8_1_0 // ============================== CODE /* function php_other_curl_curlstringfile_construct($data, $postname, $mime = "application/octet-stream") { $return_curlstringfile_construct = null; // ========== CURLSTRINGFILE_CONSTRUCT - BEGIN // ===== ABOUT // Create a CURLStringFile object // ===== DESCRIPTION // Creates a CURLStringFile object, used to upload a file with CURLOPT_POSTFIELDS. // ===== SUPPORTED // PHP_8 >= PHP_8_1_0 // ===== SYNTAX // public CURLStringFile::__construct(string $data, string $postname, string $mime = "application/octet-stream") // ===== CODE $return_curlstringfile_construct = new CURLStringFile( $data, // string data - The contents to be uploaded. $postname, // string postname - The name of the file to be used in the upload data. $mime // string mime - MIME type of the file (default is application/octet-stream). ); // Return // CURLStringFile // ===== LITERATURE_SOURCES // * PHP_NET (2024-01-08) // URL: https://www.php.net/manual/en/curlstringfile.construct.php // ========== CURLSTRINGFILE_CONSTRUCT - END // SYNTAX: // CURLStringFile CURLStringFile::__construct(string $data, string $postname, string $mime = "application/octet-stream") return $return_curlstringfile_construct; // CURLStringFile } */ // ============================== END // PHP_OTHER_CURL_CURLSTRINGFILE_CONSTRUCT // ============================== // ============================== END // PHP_OTHER_CURL_CURLSTRINGFILE // ============================== // ============================== END // PHP_OTHER_CURL // ============================== ?>