Codice PHP:
$email $_POST['email'];
    
$id $_POST['userid'];
    
$username  $_POST['username'];
    
    
$i 0;
    foreach(
$id as $key => $value) {
        
mysql_query("INSERT INTO ciao (id, email, username) VALUES ('" $value "', '" $mail[$i]  . "', '" $username[$i] . "')");
        
$array[] = array('id' => $value'email' => $email[$i], 'username' => $username[$i]);
        
$i++;
    } 
...brutta bestia l'ignoranza...