自动添加或删除表单中的行,使用PHP进行处理

I'm using the script below to automatically add new lines in a form, but I do not see how to retrieve the values ​​of each field under PHP with $_POST. If someone has already had this problem with a table in a form, thank you for helping me! what procedure to retrieve in test5.php the values ​​of the fields. I do not know how to get an array in a $_POST

thank you in advance

Here is my script

<html>

<head>
</head>

<body>
    <form action="test5.php" method="post">
        <div id="address">
            <div id="1" name="address[]">
                <input id="mail" type="text" />
                <input id="type" type="text" />
                <input id="comment" type="text" />
                <a href="#" class="removeclass" style="display:none;">&times;</a>
            </div>
        </div>

        <input id="add_address" type="button" value="Ajouter" />
        <input type="submit" value="Create PDF" />
    </form>
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
    <script type="text/javascript">
        $('#add_address').click(function(event) {
            var lastDiv = $('#address > div').last();
            var id = parseInt(lastDiv.attr("id")) + 1;
            (lastDiv.clone(true).attr("id", id)).insertAfter(lastDiv).find(".removeclass").show();
            return false;
        });

        $('body').on('click', '.removeclass', function(event) {
            $(this).parent().remove();
            return false;
        })
    </script>
</body>

</html>

1.) Remove the name-attribute from the div-element

2.) Build your input-elements like:

<div id="..">
<input type="..." name="address[1][mail]" />
<input type="..." name="address[1][type]" />
<input type="..." name="address[1][comment]" />
</div>
<div id="..">
<input type="..." name="address[2][mail]" />
<input type="..." name="address[2][type]" />
<input type="..." name="address[2][comment]" />
</div>

I modified my script as below and in test5.php, I can view the data with this script.

<? Php
// print_r ($ _ POST);
echo $ _POST ['mail'] [2];
?>

Thanks

-------------test5.php-------------

<div id="address">
    <div id="1">
        <input type="text" name="mail[]"  />
        <input type="text" name="type[]" />
        <input type="text" name="comment[]"  />
    </div>
</div>