|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 Patchesadd-http_build_query_develop-function (last revision 2015-12-29 14:13 UTC by hzgdys at 163 dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits              [2019-03-26 16:48 UTC] mike@php.net
 
-Status: Open
+Status: Verified
-Type:   Bug
+Type:   Feature/Change Request
  [2022-12-03 06:43 UTC] robertsonldspj596 at gmail dot com
 | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 09:00:01 2025 UTC | 
Description: ------------ Trying to set multidimensional array as CURLOPT_POSTFIELDS issues a NOTICE, and I suppose that end user should make a string out (that way it's allright). However, I see no way to pass a multidimensional array and a file together using CURLFile - which is encouraged as of 5.5.0 (and since '@' notation is deprecated). Test script: --------------- <?php $data = [ 'checked' => ['a', 'b', 'c'], ]; $ch = curl_init(); curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query ($data)); // works fine curl_setopt ($ch, CURLOPT_POSTFIELDS, $data); // Notice: Array to string conversion in test.php on line 12 $data = [ 'checked' => ['a', 'b', 'c'], 'file' => new CURLFile ('test.php') ]; curl_setopt ($ch, CURLOPT_POSTFIELDS, $data); // Notice: Array to string conversion in test.php on line 20