Wrap them in {}
:
${"file" . $i} = file($filelist[$i]);
Working Example
Using ${}
is a way to create dynamic variables, simple example:
${'a' . 'b'} = 'hello there';
echo $ab; // hello there
Wrap them in {}
:
${"file" . $i} = file($filelist[$i]);
Using ${}
is a way to create dynamic variables, simple example:
${'a' . 'b'} = 'hello there';
echo $ab; // hello there