zoukankan      html  css  js  c++  java
  • php多文件上传数组 转换

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <body>


    <form action="" method="post" enctype ="multipart/form-data">
    <input  name="UpLoadFile[]" type="file" value="1"/>
    <input  name="UpLoadFile[]" type="file" value="2"/>
    <input  name="UpLoadFile[]" type="file" value="3"/>



    <input  name="aa[]" type="hidden" value="2"/>
    <input  name="aa[]" type="hidden" value="3"/>


    <input type="submit" name="Button1" value="Button" id="Button1" />
    </form>


    </body>
    </html>



    <?php

    print_r($_FILES['UpLoadFile']);

    $arr = array();

    if(!empty($_FILES['UpLoadFile'])){
        


        foreach($_FILES['UpLoadFile'] as $k=>$v){
            foreach($v as $kk=>$vv){
                if($kk==$kk){
                    $arr[$kk][$k] = $vv;
                };
            }
        }
        print_r($arr);
        exit();
    }


    print_r($_POST);
    print_r($_FILES);

    ?>

  • 相关阅读:
    相关系数
    T检验
    Python模块常用的几种安装方式
    DOM与SAX读取XML方式的不同
    Base64编码
    node.js网页爬虫
    Node.js Express 框架
    Node.js Web 模块
    Node.js GET/POST请求
    Node.js 常用工具
  • 原文地址:https://www.cnblogs.com/yingjie13/p/3926787.html
Copyright © 2011-2022 走看看