I'm using the Codeigniter Curl library, and the author uses the integer equivalents of the curl options. The php manual says this for curl_setopt_array:
The keys should be valid curl_setopt() constants or their integer equivalents.
How do I figure out what the integer equivalents are for a constant? I've googled it but haven't found anything.
Thanks, Mark
curl setopt($ch, option, value) sets a cURL session option defined by the ch parameter. The value specifies the value for the specified option, and the option specifies which option to set. Return page contents with curl setopt($ch, CURLOPT RETURNTRANSFER, 1). If the value is zero, no output will be returned.
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.
You can use curl_easy_escape to URL encode your data, if necessary. It returns a pointer to an encoded string that can be passed as postdata. Using CURLOPT_POSTFIELDS implies setting CURLOPT_POST to 1. If CURLOPT_POSTFIELDS is explicitly set to NULL then libcurl will get the POST data from the read callback.
The curl_init() function will initialize a new session and return a cURL handle. curl_exec($ch) function should be called after initialize a cURL session and all the options for the session are set. Its purpose is simply to execute the predefined CURL session (given by ch).
$arr = get_defined_constants(true);
var_dump($arr['curl']);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With