Go Back   nV News Forums > Software Forums > Software Development

Newegg Daily Deals

Reply
 
Thread Tools
Old 07-25-07, 08:59 AM   #13
evilghost
Registered User
 
Join Date: Jul 2005
Posts: 3,606
Default Re: Save coding to database

Never had to use \\r\\n, I would think since it's a CRLF you'd use \r\n to strip it...but you would be right, it could be a literal \r\n. I just confused myself I think.
evilghost is offline   Reply With Quote
Old 07-25-07, 09:17 AM   #14
ViN86
 
Join Date: Mar 2004
Posts: 15,486
Default Re: Save coding to database

Quote:
Originally Posted by evilghost
Never had to use \\r\\n, I would think since it's a CRLF you'd use \r\n to strip it...but you would be right, it could be a literal \r\n. I just confused myself I think.
well, the reason it's displaying "rn" on his screen is that its actually "\r\n" but PHP is escaping the backslashes and displaying the "rn" part. it's the same when you want to output a quote.

you cant use
Code:
echo """;
that would give you a syntax error...

youd have to use
Code:
echo "\"";
the backslash is not printed. so, although the "\r\n" is present, PHP is outputting it as "rn". so, to remove this you need to use "\\r\\n" as that would equate to "\r\n" in PHP.

this right? maybe im talkin out of my ass now
ViN86 is offline   Reply With Quote
Old 07-25-07, 09:19 AM   #15
evilghost
Registered User
 
Join Date: Jul 2005
Posts: 3,606
Default Re: Save coding to database

AFAIK \r\n is chr(13) + chr(10), the text area has chr(13)chr(10) because of the Win32 CRLF and PHP sees it as \r\n just like a tab would be \t so to remove chr(13)chr(10) and convert it to <BR> you would use a str_replace on \r\n
evilghost is offline   Reply With Quote
Old 07-25-07, 09:26 AM   #16
ViN86
 
Join Date: Mar 2004
Posts: 15,486
Default Re: Save coding to database

Quote:
Originally Posted by evilghost
AFAIK \r\n is chr(13) + chr(10), the text area has chr(13)chr(10) because of the Win32 CRLF and PHP sees it as \r\n just like a tab would be \t so to remove chr(13)chr(10) and convert it to <BR> you would use a str_replace on \r\n
good point.

oh well, guess all we can do is wait for him to test it
ViN86 is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Verizon's shared data plans won't save solo users much money News Archived News Items 0 06-12-12 11:40 AM
League of Legends database hacked. Riot Games 'appreciate your immediate attentionā News Gaming Headlines 0 06-09-12 12:10 PM
NVISION: Create Games Without Any Coding Knowledge News Archived News Items 0 05-30-12 05:26 AM
Girls Impress FIRST Championship With Project That Could Save Lives (GeekDad Weekly R News Archived News Items 0 05-13-12 06:30 PM
Benchmark database? Necromancer NVIDIA Windows Graphics Drivers 1 08-25-02 11:15 AM

All times are GMT -5. The time now is 04:12 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright ©1998 - 2014, nV News.