开发者

Get name of first file in files[] array

I have an array of files posted with name="files[]" an开发者_开发百科d id like to take the name of the first file and assign it the variable $first_file. When i do $first_file = $_FILES['files']['name']; it just returns 'array'.


Easy:

$_FILES['files']['name'][0];


Try

$_FILES['files']['name'][0];


You can use

$_FILES['files']['name'][0]

By the way, If you want to see all the keys you can do

print_r($_FILES['files']['name']);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜