Re: Printing \n and \r to the screen

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/25/05, Richard Lynch <ceo@xxxxxxxxx> wrote:
> 
> Windows uses \r\n
> Linux uses \n
> Mac uses \r
> 
> Depending on what tools you use to read/write/create the files, and
> where the data comes from, it's possible that you have any of those
> formats.
> 
> This is especially true of FORM data from a TEXTAREA.
> 
> I frequently do this:
> 
> $text = $_POST['text'];
> $text = str_replace("\r\n", "\n", $text);
> $text = str_replace("\r", "\n", $text);
> //Now I *know* it's in Linux newline format.
> 
> Like Music?
> http://l-i-e.com/artists.htm

Thanks, Richard. Jochem pointed that out earlier. I really should have
googled this first, but I was certain that what I _knew_ was right.
That happens sometimes. Now get that Uranus branch up!

Dotan
http://lyricslist.com/lyrics/artist_albums/395/papa_roach.php
Papa Roach Song Lyrics

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux