How can I get the html form name from php with multiple file uploads? -
if handle file uploads:
if ($_files) { foreach ($_files $file) { //...handle upload process } }
is there way can key of file? in:
<input type="file" name="myfile" />
i want know file coming "myfile".
edit: obvious solution turns out be:
foreach($_files $key => $file) { $input_name = $key; // handle upload. }
if input name in form myfile
, in $_files
array as:
$_files['myfile']
so can do:
foreach ($_files $inputname => $fileinfo) { }
check out handling file uploads more info.
Comments
Post a Comment