Due to a need of the system we are working on, I need to send 3 fields as an array to a PHP. Example:
<input type="text" name="name[]" />
<input type="text" name="name[]" />
<input type="text" name="name[]" />
What happens is that even though I select only one, it brings the result informed and the others blank. And the count of the array always returns 3:
Teste DIEGO . Fim
Teste . Fim
Teste . Fim
How could you handle the array only having the data actually entered? I display it this way (testing):
foreach( $name as $key => $n ) {
print "Teste ".$n.". Fim<br>";
}