You are here: Re: String Problems - newline appears as text « All PHP « IT news, forums, messages
Re: String Problems - newline appears as text

Posted by Dae.OS on 05/23/06 01:28

Jonathan Tremlett a écrit :
> Hi Chris,
>
> Your solution does not seem to work.
>
> echo "Hello \n World"; outs to Hello World
>
> I am sure I have written this before without this trouble. Have you any
> further advice?
>
> Jonathan Tremlett
>

HTML treats newlines as spaces, just like it treats several spaces as
one space. To print a line break in HTML use the <br /> tag or the
nl2br() function:

echo "Hello<br />World";
or
echo nl2br("Hello\nWorld");

Dae

 

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

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