Apresenta erro: Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\tarefas.php on line 35
Tarefas
<label>
Tarefa:
<input type="text" name="nome">
</label>
<input type="submit" value="Cadastrar">
</fieldset>
</form>
<?php
$lista_tarefas = array();
if (isset($_GET['nome'])) {
$lista_tarefas = $_GET['nome'];
}
?>
<table>
<tr>
<th>Tarefas</th>
</tr>
<?php foreach ($lista_tarefas as $tarefa) : ?>
<tr>
<td><?php echo $tarefa; ?> </td>
</tr>
<?php endforeach; ?>
</table>