Re: returning the index number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Robert Cummings wrote:
On Tue, 2007-06-05 at 11:43 -0400, Robert Cummings wrote:
On Tue, 2007-06-05 at 16:39 +0100, blueboy wrote:
I have an array of files to be uploaded

<td><input name="userfile[]" type="file"></td>
</tr>
<tr>
<td> 2.</td>
<td><input name="userfile[]" type="file"></td>
</tr>
<tr>
<td>3.</td>
<td><input name="userfile[]" type="file">


I can get the name

  $i = 0;
foreach ($_FILES['userfile']['name'] as $value) {

  echo $value
    $i++;
  }

I should be shot for the above... use the following:

foreach ($_FILES['userfile']['name'] as $i => $value)
{
    echo $value;
}

Cheers,
Rob.
I was going to say something.... :D

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
       and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux