Re: problem with file upload

From: Date: Fri, 19 Jan 2001 17:51:18 +0000
Subject: Re: problem with file upload
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-35669@lists.php.net to get a copy of this message
> <? > for ($i=0 ; $i < 4 ; $i++) > { > file://do something > > for ($k=0 ; $k < 3 ; $k++) > { > print "<input type=\"checkbox\" name=\"checkans[$i][$k]\" > value=\"".$K."\" >"; file://this is working > print "<input type=\"file\" name=\"ans[$i][$k]\" > >"; file://this is > not > } > } For FORMs, files as arrays were added in later, and then 2-D arrays came after that. So probably there is no patch yet for 2-D FILE inputs. You're probably receiving all the files in a 1-D array, with funky indices (keys): $ans['0][0'] is the first file. $ans['0][1'] is the second file etc If so, you can walk that and use explode('][', $key) to determine the indices you really wanted and re-construct your desired array. Something like: while (list($key, $value) = each($ans)){ $keys = explode('][', $key); list($x, $y) = each($keys); $realans[$x][$y] = $value; } By Day: |By Night: Don't miss the Zend Web Store's | There's not enough room here... Grand Opening on January 23, 2001! | Start here: http://www.zend.com | http://l-i-e.com/artists.htm

« previous php.general (#35669) next »