0 Usuarios y 1 Visitante están viendo este tema.
<?php if(isset($_POST['texto'])){$texto = explode("\n ", $_POST['texto']);}?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Documento sin título</title></head><body><form id="form1" name="form1" method="post" action=""> <textarea name="texto" id="texto"></textarea> <input type="submit" name="button" id="button" value="Enviar" /></form><?php foreach ($texto as $indice => $valor){ echo "Linea ".$indice." Con el valor: ".$valor; } ?></body></html>
<?php if(isset($_POST['texto'])){ $texto = nl2br($_POST['texto']); $texto = explode("<br />",$texto); }?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Documento sin título</title></head><body><form id="form1" name="form1" method="post" action=""> <textarea name="texto" id="texto"></textarea> <input type="submit" name="button" id="button" value="Enviar" /></form><?php foreach ($texto as $indice => $valor){ echo "Linea ".$indice." Con el valor: ".$valor."<br />"; } ?></body></html>
Array ( [el_texto] => abcd otra linea ultima linea fin ) Array ( [0] => abcd [1] => otra linea [2] => ultima linea [3] => fin )