Re: problem with "count" function ...

From: Date: Tue, 06 May 2003 19:31:54 +0000
Subject: Re: problem with "count" function ...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-146551@lists.php.net to get a copy of this message
> Greetings. Hiya... > I'm sure I'm overlooking something simple, but I just can't see it ... > > I'm trying to upload multiple files via PHP, having built a forms page > with 10 > > <input type=file name='userFile'> Make this an array: <input type="file" name="userFile[]"> > statements ... and I'm trying to determine how many times to process my > upload handling loop with > > for ($i=0; $i<count($_FILES['userFile']); $i++) This should work now. Display a print_r($_FILES) to see what the exact structure of the array is. Also, it'd be more efficient to get the count outside of your for() loop and just use a variable within the loop. > but no matter how many files I try to upload, I get a count of 4 ... Those are the 4 properties of the file, type, size, name, etc... ---John Holmes...

« previous php.general (#146551) next »