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

curl-and-php

CURLOPT_POSTFIELDS and associative arrays

From: <timhewitt_at_myostrich.net>
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
work.

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?

Thanks,

-Tim

_______________________________________________________________

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