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 Rik on 05/23/06 00:28

Jonathan Tremlett wrote:
> I was wondeirng if someone can help me? I am displaying a string on
> screen and all I want to do is make it take a new line.


Manual -> types -> strings
http://nl2.php.net/manual/en/language.types.string.php

Use:
echo "Hello\nworld"
or
echo 'Hello
world';

Also note the newline will appear between <pre> tags in HTML, but normally
you would have to nl2br() your strings to make in viwible in HTML. The
source will have a newline.

Grtz,
--
Rik Wasmus

 

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

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