php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #44519 curl documentation lists CURLOPT_POSTFIELDS as string, should be mixed
Submitted: 2008-03-24 18:33 UTC Modified: 2008-10-01 08:37 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: stefan dot nolde at lazos dot cl Assigned: kalle (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: any
Private report: No CVE-ID: None
 [2008-03-24 18:33 UTC] stefan dot nolde at lazos dot cl
Description:
------------
The documentation about curl_setopt lists the CURLOPT_POSTFIELDS parameter under "should be string".
The parameter can be string OR array though, in case of file uploads it saves a lot of headaches if it is an array, plus it removes the necessity of urlescaping the post data.

Best practice would be to list it as both string and array, maybe with a hint like:
CURLOPT_POSTFIELDS may be passed as a urlencoded string in the form "field1=data1&field2=data2..." or as an array with the fieldname as key and the field data as value.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-01 08:37 UTC] kalle@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2020-02-07 06:10 UTC] phpdocbot@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=0d71bfe70603d98b2c181a2fc100922d4ef377f4
Log: Fixed bug #44519 (curl documentation lists CURLOPT_POSTFIELDS as string, should be mixed)
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 06:00:01 2026 UTC