PHP Post CheckBox返回空数组

I have used this to collect the checkbox value array.

    <form action="example.php" method="post" name="deleteform">
    <input type="submit" value="delete"/>

    <table>
    <?php

    foreach ($memArray as $row) {
       echo "<tr align=\"center\">
       <td><input type=\"checkbox\" value=\"".$row['cus_id']."\" name=\"del[]\" /></td>";   
         echo "</tr>";  
    }
    ?>
    </table>
</form

>

if the form is Posted, then do

    $delArray = $_POST['del'];

    print_r($delArray);

But the result returned Array, but nothing inside

I have changed name=del instead of name=del[], and it works . But when i add the [] back it return empty array

you should check 2 things.

first is form method. whether it is post or get..

second when you submit the page, check box is checked or not. if it is not checked then you can not have array in $_GET or in $_POST

Here is your code, though i have made changes to loop. checkbox.php is the current file name.

    <?php
    if(isset($_POST['delete']))
    {
        print_r($_POST['del']);
    }
?>
<form action="checkbox.php" method="post" name="deleteform">
<input type="submit" value="delete" name="delete"/>

<table>
<?php

for($i=0;$i<5;$i++) {
   echo "<tr align=\"center\">
   <td><input type=\"checkbox\" value=\"".$i."\" name=\"del[]\" /></td>";
     echo "</tr>";  
}
?>
</table>

Compare it with your code. On submit you'll get definitely get array.