The curl_setopt () function sets options for a CURL session. The option parameter is the setting you want, and the value is the value given by this option.
The values of the following options will be used as long integer (specified in the option parameter ):
CURLOPT_INFILESIZE: When you upload a file to a remote site, this option tells PHP about the size of the file to be uploaded.
CURLOPT_VERBOSE: If you want CURL to report every unexpected event, set this option to a non-zero value.
CURLOPT_HEADER: If you want to include a header in the output, set this option to a non-zero value.
CURLOPT_NOPROGRESS: If you do not display a process entry for CURL transmission in PHP, set this option to a non-zero value.
Note: PHP automatically sets this option to a non-zero value. You should change this option only for debugging purposes.
CURLOPT_NOBODY: If you do not want to include the body in the output, set this option to a non-zero value.
CURLOPT_FAILONERROR: If you want PHP not to be displayed when an error occurs (HTTP code returns a value greater than or equal to 300), set this option to a non-zero value. By default, a normal page is returned, ignoring the code.
CURLOPT_UPLOAD: If you want PHP to prepare for upload, set this option to a non-zero value.
CURLOPT_POST: If you want PHP to create a regular http post, set this option to a non-zero value. This POST is a common application/x-www-from-urlencoded type, most of which are used by HTML forms.
CURLOPT_FTPLISTONLY: set this option to a non-zero value. PHP will list the FTP directory names.
CURLOPT_FTPAPPEND: set this option to a non-zero value. PHP overwrites the remote application file.
CURLOPT_NETRC: set this option to a non-zero value. PHP will be in your ~. In the/netrc file, find the username and password of the remote site you want to establish a connection.
CURLOPT_FOLLOWLOCATION: set this option to a non-zero value (like "Location:") header. The server will send it as part of the HTTP header (note that this is recursive, PHP will send the header like "Location ).
CURLOPT_PUT: set this option to a non-zero value to upload a file over HTTP. To upload this file, you must set the CURLOPT_INFILE and CURLOPT_INFILESIZE options.
CURLOPT_MUTE: set this option to a non-zero value, and PHP will completely silence the CURL function.
CURLOPT_TIMEOUT: specifies the maximum number of seconds for a long integer.
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to email@example.com. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
and provide relevant evidence. A staff member will contact you within 5 working days.