在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/數(shù)據(jù)分析&挖掘  PHP  Linux  網(wǎng)絡(luò)安全  HTML/ php curl模擬input數(shù)組形式上傳圖片

php curl模擬input數(shù)組形式上傳圖片

能不能通過(guò)curl模擬出下面html的形式來(lái)上傳圖片

<input type="file" name="imgs[]"/>
<input type="file" name="imgs[]"/>
<input type="file" name="imgs[]"/>

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

也就是說(shuō)是這種。但是這個(gè)會(huì)報(bào)錯(cuò),Array to string conversion

我用http_build_query()來(lái)處理。但是這樣處理之后$_FILES就接收不到值了

請(qǐng)問(wèn)有沒(méi)有什么辦法,可以解決

回答
編輯回答
離魂曲

既然HTML inputnameimgs[],那curl也用這個(gè)就行了($data['imgs[]']=$file_obj),而不是搞個(gè)數(shù)組。

2017年3月5日 15:25