You are here: Re: How to format text from HTML textarea? « PHP Programming Language « IT news, forums, messages
Re: How to format text from HTML textarea?

Posted by deko on 03/17/07 13:17

>> Is there a way to preserve line breaks and other formatting when coping to a
>> file from a HTML textarea?
>
> Use the nl2br() function when printing out that
> information. (http://www.php.net/nl2br )
>
> To remove the \ signs there is a function called strip_slashes().

Thanks for the tip. This seems to do the trick:

$feedback = trim($_POST['feedback_textarea']);
$feedback = nl2br($feedback);
$feedback = stripslashes($feedback);

That was easy :)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация