Re: [PHP] Retaining formatting problem[Scanned]

2003-07-08 Thread Mike Migurski
> cannot have multiple lines, use this
>
>little amount of
>
>text

This is true.

Also, watch the line endings coming aout of that textarea - you may want
to normalize them. I prefer unix linebreaks, so I use this to convert mac
and DOS endings:

str_replace(array("\r\n", "\r"), "\n", $textarea_value)

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Retaining formatting problem[Scanned]

2003-07-08 Thread Mark

--- Michael Egan <[EMAIL PROTECTED]> wrote:
> I've experienced the same problem. It's not that the line returns
> disappear - they will still be retained but stored as /n or /r.  
> 
> You'll need to find a way of replacing the line breaks with a html
> paragraph break - assuming your required output is html. Perhaps
> some of the regexp functions will help in this - I haven't got the
> code I used for this to hand.

You mean something like the nl2br() function?

> 
> HTH,
> 
> Michael Egan
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: 08 July 2003 10:30
> To: [EMAIL PROTECTED]
> Subject: [PHP] Retaining formatting problem[Scanned]
> 
> 
> Hello everyone,
> 
> I have a long running problem that i just want to get covered, I
> have a standard text box for people to insert long lengths of text.
> 
> This text box is in a standard  but when I
> insert it into the database the line returns dissapear, eg 
> 
> "this 
> 
> little amount of
> 
> text"
> 
> will enter like
> 
> "this little amount of text will enter like"
> 
> Please help me it is p!!$$!ng me right off :P
> 
> Cheers in advance
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a "right" unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***

__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Retaining formatting problem[Scanned]

2003-07-08 Thread Marek Kilimajer
 cannot have multiple lines, use this

little amount of

text

Michael Egan wrote:

I've experienced the same problem. It's not that the line returns disappear - they will still be retained but stored as /n or /r.  

You'll need to find a way of replacing the line breaks with a html paragraph break - assuming your required output is html. Perhaps some of the regexp functions will help in this - I haven't got the code I used for this to hand.

HTH,

Michael Egan

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 08 July 2003 10:30
To: [EMAIL PROTECTED]
Subject: [PHP] Retaining formatting problem[Scanned]
Hello everyone,

I have a long running problem that i just want to get covered, I have a standard text box for people to insert long lengths of text.

This text box is in a standard  but when I insert it into the database the line returns dissapear, eg 

"this 

little amount of

text"

will enter like

"this little amount of text will enter like"

Please help me it is p!!$$!ng me right off :P

Cheers in advance



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Retaining formatting problem[Scanned]

2003-07-08 Thread Michael Egan
I've experienced the same problem. It's not that the line returns disappear - they 
will still be retained but stored as /n or /r.  

You'll need to find a way of replacing the line breaks with a html paragraph break - 
assuming your required output is html. Perhaps some of the regexp functions will help 
in this - I haven't got the code I used for this to hand.

HTH,

Michael Egan

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 08 July 2003 10:30
To: [EMAIL PROTECTED]
Subject: [PHP] Retaining formatting problem[Scanned]


Hello everyone,

I have a long running problem that i just want to get covered, I have a standard text 
box for people to insert long lengths of text.

This text box is in a standard  but when I insert it into the 
database the line returns dissapear, eg 

"this 

little amount of

text"

will enter like

"this little amount of text will enter like"

Please help me it is p!!$$!ng me right off :P

Cheers in advance

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php