i need to reproduce with the code below something like:
myformdata[languages1]
myformdata[languages2]
myformdata[languages3]
But with this code only reproduce myformdata[languages
<?php
$sql=mysql_query("select id_spoken_languages, language, path from spoken_languages");
$i=0;
while($row=mysql_fetch_array($sql)) {
$id=$row['id_spoken_languages'];
$data=$row['language'];
$flag=$row['path'];
echo nl2br ("<input type='checkbox' name='myformdata[languages'.$i++.']' value='$id' class='semLargura'>$data <img style='float:right; margin-top:5px; border:1px solid grey;' src='$flag'></img>
");
}
?>
i already tried remove the increment and only access with $form_data_array["languages"][1]
but in this case i get:
Notice: Uninitialized string offset: 1 in C:\Users\fel\VertrigoServ\www\login\validation2.php on line 9
but if i use `$form_data_array["languages"][0], no error is showed, seems like all checkbox have the index 0.
what is the best way to solve this problem?