Your issue is that you're creating an array with the variable $file by using the [] after the variable name. This will automatically add an array element, or create an array if it isn't one already.
Three options:
1.) Simplist:
[indent]Remove the "[]" after $file, and $newfile and everything should work fine. Then you're just using the variables as such, and not arrays.[/indent]
2.) More of what you want:
[indent]Remove the if(){} statement from the foreach() loop. When you're done, then run an itterative for() loop while $i is less than total number of elements in $files. Then do your copy() items on $file[$i].[/indent]
3.) Most likely the best:
[indent]Change your code slightly so that you add two lines:
$t_file = '\in\'.$value;
$t_newfile = '\process\'.$value;
Then, in the if statement, change $file to $t_file and $newfile to $t_newfile.[/indent]
Right now, even if you weren't using arrays, your code is still incorrect as the value of $value wouldn't be parsed. So you'd have an array of the same value: \in\$value[\b], literally. You'd need to use double quotes: " or concatenate the string if you want to use single quotes: '. Also, watch your backslashes. They double as escapes. Typically, it's best to use forward slashes (Windows can translate as needed).
Here's the best way to do it (in my opinion):
<?php
foreach($_POST['checkbox'] as $value)
{
$t_file = '\in\\'.$value;
$file[] = '\in\\'.$value; // Gotta concatenate with single quotes
$t_newfile = '\process\\'.$value;
$newfile[] = "\process\\$value"; // Or use double quotes to allow PHP to parse variables
if (!copy($t_file, $t_newfile)) {
echo "failed to copy $file...\n";
}
}
?>