Upload multiple files with curl
问题 How do I upload multiple files in an array using CURLFile and curl_setopt ? Using the data array as it would throw an error (can't convert an array to a string) and http_build_query on the data would corrupt the CURLFile objects. The data I have to upload looks like that: [ 'mode' => 'combine', 'input' => 'upload', 'format' => $outputformat, 'files' => [ [0] => CURLFile object, [1] => CURLFile object, [x] => ... ] ] 回答1: PHP 5.5+ has a function to create files without using CURLFile: curl