Hello everyone -
I wrote a function that handles uploads, and to call it variables are
defined like this:
function handleupload($gofile, $name, $size, $usersname) {
// the action goes here
}
However, I need to use the $_files array to call the uploaded files in a for
function. The first uploaded file is $_FILES['file1']['tmp_name'], and the
second is $_FILES['file2']['tmp_name'], and so on. How do I use the $i
scalar used in the for loop to replace 1 and 2 in the $_FILES array? I tried
these but they didnt work:
handleupload("$_FILES['file".$i."']['tmp_name']",
"$_FILES['file".$i."']['name']", "$_FILES['file".$i."']['size']",
$_COOKIE['cookie']['id']);
handleupload("$_FILES['file$I']['tmp_name']",
"$_FILES['file$i']['name']", "$_FILES['file$i']['size']", $username);
This is probably simple, but I'm new to this. So, how can I incorporate the
name of a scalar in another scalar's name in order to call a function?
Thanks,
Matt