|
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.
>
>
Navigation:
[Reply to this message]
|