Forum Moderators: coopster

Message Too Old, No Replies

CURL Session

is it an object or...?

         

Code Sentinel

3:07 am on Aug 5, 2005 (gmt 0)

10+ Year Member



So you initialize a curl session like so:

$ch = curl_init()

what is $ch exactly? an object?

If I wanted to pass $ch to a function which can set options based on user input for example, would I pass by reference or by value?

jatar_k

3:55 am on Aug 5, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



if you look at the function definition you will see

resource curl_init ( [string url] )

$ch will end up being a resource

The curl_init() will initialize a new session and return a CURL handle for use with the curl_setopt(), curl_exec(), and curl_close() functions.

pass it like you would a connection to mysql

$connect = mysql_connect(.....