Re: Campo BLOB en MySQL
| From: | Xavier Paz | Date: | Wed, 13 Dec 2000 12:26:38 +0000 |
| Subject: | Re: Campo BLOB en MySQL | ||
| References: | 1 2 3 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-4914@lists.php.net to get a copy of this message | ||
Hola,
Está en el manual de PHP:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
nl2br -- Converts newlines to HTML line breaks.
Description
string nl2br(string string);
Returns string with '<BR>' inserted before all newlines.
See also htmlspecialchars() and htmlentities().
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Con el campo de texto que recibes del form, tienes que hacer algo así:
$descripcion = nl2br ($descripcion);
nl2br añade '<BR>' antes de cada '\n', con lo que lo puedes mostrar como
un texto HTML.
También vale la pena que pases el texto por htmlentities(), para evitar
que te metan código HTML o Javascript. Hay gente bastante rara por ahí.
Algo así: $descripcion = htmlentities (nl2br ($descripcion));
Xavier
David Ayala wrote:
>
> Teneis algun ejemplillo de como usar la funcion nl2br() ???
>