1
I am unable to print a horizontal array on an HTML page. How can I do this?
PHP:
if (isset($_GET['nome']) && $_GET!=['nome']) {
$lista_tarefa = array();
$lista_tarefa['nome'] = $_GET['nome'];
}
if (isset($_GET['descricao'])) {
$lista_tarefa['descricao'] = $_GET['descricao'];
} else {
$lista_tarefa['descricao'] = '';
}
PHP+HTML:
<table>
<?php foreach ($lista_tarefa as $tarefa) : ?>
<tr>
<td> <?php echo $tarefa; ?> </td>
</tr>
<?php endforeach; ?>
</table>
Are you sure that first if this right? do not understand that
$_GET!=['nome']
– Édipo Costa Rebouças
The right thing is: $_GET!= ['name']!=''
– GtGtGt
Still seems to be wrong.
– Édipo Costa Rebouças
No, that’s how it is. But, another problem has arisen... I have 5 input="text" and I want to add 5 values and when calling my Ubmit, print them in a table horizontally. OK, I got this. But, I want to add 5 more, 5 more and 5 more... But in doing so he prints beside it, I want him to go down and print on the bottom line. How do I do this?
– GtGtGt
Open another question. And if the answer is right. Mark as correct.
– Édipo Costa Rebouças