cURL / Mailing Lists / curl-and-php / Single Mail


CURLOPT_POSTFIELDS and associative arrays

From: <>
Date: Thu, 09 May 2002 16:20:20 -0400

I'm new to curl, and have been trying to use an associative array as the
argument to CURLOPT_POSTFIELDS. According to the upgrade notes for PHP
v4.0.3, this is now possible, but I can't for the life of me make it

I can easily send a POST with the values in a string as in

  $postvalue = "a=1&b=2"
  curl_setopt($ch, CURLOPT_POSTFIELDS, $postvalue);

however I'd really like to use something like

  $postvalue['a'] = 1;
  $postvalue['b'] = 2;

Can anyone help me out here?




Have big pipes? is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us:
Received on 2002-05-09