Array( [name] => Array ( [0] => 2.png [1] => 3.png [2] => 4.png ) [type] => Array ( [0] => image/png [1] => image/png [2] => image/png ) [tmp_name] => Array ( [0] => E:\phpstudy\tmp\tmp\phpDE5B.tmp [1] => E:\phpstudy\tmp\tmp\phpDE5C.tmp [2] => E:\phpstudy\tmp\tmp\phpDE5D.tmp ) [error] => Array ( [0] => 0 [1] => 0 [2] => 0 ) [size] => Array ( [0] => 10731 [1] => 9123 [2] => 27612 ))
假設此二維數組叫f,我想在遍曆數組的同時,把f['name']['0']
賦值給一個變數,又同時把f['tmp_name']['0']
賦值給一個變數,兩次賦值同時進行,請問我該怎麼弄
回複內容:
Array( [name] => Array ( [0] => 2.png [1] => 3.png [2] => 4.png ) [type] => Array ( [0] => image/png [1] => image/png [2] => image/png ) [tmp_name] => Array ( [0] => E:\phpstudy\tmp\tmp\phpDE5B.tmp [1] => E:\phpstudy\tmp\tmp\phpDE5C.tmp [2] => E:\phpstudy\tmp\tmp\phpDE5D.tmp ) [error] => Array ( [0] => 0 [1] => 0 [2] => 0 ) [size] => Array ( [0] => 10731 [1] => 9123 [2] => 27612 ))
假設此二維數組叫f,我想在遍曆數組的同時,把f['name']['0']
賦值給一個變數,又同時把f['tmp_name']['0']
賦值給一個變數,兩次賦值同時進行,請問我該怎麼弄
for ($i = 0; $i < 3; ++$i) {
$first = $f['name'][$i];$second = $f['tmp_name'][$i];...
}