Reply to Re: newline characters & textarea

Your name:

Reply:


Posted by Stefan Rybacki on 10/20/05 21:32

Chris Thompson wrote:
> Hi,
>
> I have a mysql table that has a column called 'Address'. In this column I
> store the value entered into a 6x40 text area.
>
> After I insert data into the table, and look at it in phpmyadmin, it looks
> correctly formatted (i.e. each row of the address starts on a new line, but
> there are no \r or \n showing).
>
> Similarly, if I put the data back into a textarea, the address correctly
> formats and starts a new line for each line of the address.
>
> However, I don't want to put the output into a textarea... I want to put it
> into a table, but when I do this the formatting is lost, and the address
> just outputs in one long line.
>
> I've tried various things to try to get the text to format like it would in
> a textarea, but I'm stuck...
>
> As I say, the text in the table doesn't have any visible \r or \n's in it,
> so I can't do a replace for <br>'s.

Oh yes there are. Use the well known php function nl2br and you're done.

>
> Anyone any idea how I can replace the invisible newline breaks please???

Regards
Stefan

>
> Cheers,
> Chris.
>
>

[Back to original 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

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