有一个文档出现name="other[msn]"的input,我点提交后不能用$_POST['other[msn]'];得到提交的内容,请问怎么得到提交的内容,这里input的名称必须带中括号,我不知道这么出来
<input name="other[msn]" type="text" value="[email protected]" class="TextInput" />希望得到的内容是[email protected],请问大家怎么处理,这里只是一个举例,实际中所贴内容是动态的,希望不要告诉我直接赋值成[email protected]之类的无效回复

解决方案 »

  1.   


    <!--
    To change this template, choose Tools | Templates
    and open the template in the editor.
    -->
    <?php
    if(isset($_GET["action"]) && $_GET["action"]==="add")
    {
        echo $_POST['other']['msn'];
    }
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title></title>
        </head>
        <body>
            <form method="post" action="?action=add">
                <input name="other[msn]" type="text" value="[email protected]" class="TextInput" />
                <input type="submit" value="提交" name="" />
            </form>
        </body>
    </html>
      

  2.   

    $str = $_POST['oeher']['msn'] ;二维数组
      

  3.   

    最简单的验证方法var_dump($_POST);