第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

為什么print_r后會(huì)多出數(shù)組


function getFile() {
?? ?$i = 0;
?? ?foreach ( $_FILES as $file ) {
?? ??? ?if (is_string ( $file ['name'] )) {
?? ??? ??? ?$file [$i] = $file;
?? ??? ??? ?$i ++;
?? ??? ?} elseif (is_array ( $file ['name'] )) {
?? ??? ??? ?foreach ( $file['name'] as $key => $val ) {
?? ??? ??? ??? ?$file [$i] ['name'] = $file ['name'] [$key];
?? ??? ??? ??? ?$file [$i] ['type'] = $file ['type'] [$key];
?? ??? ??? ??? ?$file [$i] ['tmp_name'] = $file ['tmp_name'] [$key];
?? ??? ??? ??? ?$file [$i] ['error'] = $file ['error'] [$key];
?? ??? ??? ??? ?$file [$i] ['size'] = $file ['size'] [$key];
?? ??? ??? ??? ?$i ++;
?? ??? ??? ?}
?? ??? ?}
?? ?}
?? ?return? ($file);
}


Array
(
??? [name] => Array
??????? (
??????????? [0] => b.jpeg
??????????? [1] => Lighthouse.jpg
??????????? [2] => Tulips.jpg
??????????? [3] => Lighthouse.jpg
??????? )

??? [type] => Array
??????? (
??????????? [0] => application/octet-stream
??????????? [1] => image/jpeg
??????????? [2] => image/jpeg
??????????? [3] => image/jpeg
??????? )

??? [tmp_name] => Array
??????? (
??????????? [0] => D:\wamp\tmp\php6162.tmp
??????????? [1] => D:\wamp\tmp\php6163.tmp
??????????? [2] => D:\wamp\tmp\php6174.tmp
??????????? [3] => D:\wamp\tmp\php6185.tmp
??????? )

??? [error] => Array
??????? (
??????????? [0] => 0
??????????? [1] => 0
??????????? [2] => 0
??????????? [3] => 0
??????? )

??? [size] => Array
??????? (
??????????? [0] => 5
??????????? [1] => 561276
??????????? [2] => 620888
??????????? [3] => 561276
??????? )

??? [0] => Array
??????? (
??????????? [name] => b.jpeg
??????????? [type] => application/octet-stream
??????????? [tmp_name] => D:\wamp\tmp\php6162.tmp
??????????? [error] => 0
??????????? [size] => 5
??????? )

??? [1] => Array
??????? (
??????????? [name] => Lighthouse.jpg
??????????? [type] => image/jpeg
??????????? [tmp_name] => D:\wamp\tmp\php6163.tmp
??????????? [error] => 0
??????????? [size] => 561276
??????? )

??? [2] => Array
??????? (
??????????? [name] => Tulips.jpg
??????????? [type] => image/jpeg
??????????? [tmp_name] => D:\wamp\tmp\php6174.tmp
??????????? [error] => 0
??????????? [size] => 620888
??????? )

??? [3] => Array
??????? (
??????????? [name] => Lighthouse.jpg
??????????? [type] => image/jpeg
??????????? [tmp_name] => D:\wamp\tmp\php6185.tmp
??????????? [error] => 0
??????????? [size] => 561276
??????? )

)

正在回答

1 回答

嗯 就是做成這樣二維的索引+關(guān)聯(lián)形式的數(shù)組

之后在通過foreach來遍歷,將每個(gè)文件上傳成功

^-^...

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

為什么print_r后會(huì)多出數(shù)組

我要回答 關(guān)注問題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)