So I have 7 input file, and I want to retrieve each value using $_FILES
in PHP. Here are the code:
$fig1 = $_FILES['files1']['name'];
$fig2 = $_FILES['files2']['name'];
$fig3 = $_FILES['files3']['name'];
$fig4 = $_FILES['files4']['name'];
$fig5 = $_FILES['files5']['name'];
$fig6 = $_FILES['files6']['name'];
$fig7 = $_FILES['files7']['name'];
But I think that is not an efficient way.
Moreover, I want to explode the name to get the extension of the file, as here:
$value_fig1 = explode('.', $fig1);
$file_ext_fig = strtolower(array_pop($value_fig1));
and I still have 6 more variable.
So, is there any more efficient way?