Please use curlcommand in PHP for example, curl-xpost-v-ccookies.txt-d & quot; {& quot; username & quot;: & quot; uname & quot;, & quot; password & quot;: & quot; pasword & quot ;} & quot;-H & quot; Content-Type: how can I use the curl Command in PHP?
As follows:
Curl-x post-v-c cookies.txt-d "{\" username \ ": \" uname \ ", \" password \": \ "pas word \"} "-H" Content-Type: application/json "xxx.com/ah/session
This command
How to use the above commands in PHP?
Who can provide the complete example ~~~~~~~~~
------ Solution --------------------
// 1. initialization
$ Ch = curl_init ();
// 2. set options, including URL
Curl_setopt ($ ch, CURLOPT_URL, "http://www.nettuts.com ");
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 );
Curl_setopt ($ ch, CURLOPT_HEADER, 0 );
// 3. execute and obtain the HTML document content
$ Output = curl_exec ($ ch );
// 4. release the curl handle
Curl_close ($ ch );
------ Solution --------------------
Http://www.chinaz.com/program/2010/0119/104346_2.shtml
------ Solution --------------------
Discussion
Reference:
I can't even read the materials? Do you understand the meaning of the curl command line.
I just don't understand the meaning of this command line.
So I want to know how PHP translates this command line.