Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Curl, where can I find a list of integer equivelants of constants

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

like image 621
Mark Steudel Avatar asked Dec 08 '10 18:12

Mark Steudel


People also ask

What is cURL setopt?

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.

What is Curlopt_returntransfer in cURL?

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.

What is Curlopt_postfields PHP?

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.

What is curl_init?

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).


1 Answers

$arr = get_defined_constants(true);
var_dump($arr['curl']);
like image 67
ajreal Avatar answered Oct 05 '22 14:10

ajreal