Php curl simulates uploading pictures in the form of input array

can you upload pictures by curl simulating the following html form

$file_obj = curl_file_create(realpath($file), "image/png");
$data["imgs"][] = $file_obj;

that is to say, this is the kind of thing. But this will report an error, Array to string conversion

I use http_build_query () to handle it. But after this processing, $_ FILES will not receive a value

is there any way to solve


since name of HTML input is imgs [] , curl can also use this ( $data ['imgs []] = $file_obj ) instead of creating an array.

Menu