You are here: Re: [PHP] Printing \n and \r to the screen « PHP « IT news, forums, messages
Re: [PHP] Printing \n and \r to the screen

Posted by Dotan Cohen on 08/25/05 20:45

On 8/25/05, Richard Lynch <ceo@l-i-e.com> 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

 

Navigation:

[Reply to this 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

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