Hi,
I'm new to PHP.
I tried to find answers to these on the web, but couldn't find such.
I use PHP 5.2 on Win XP, Abyss and KFWS servers.
When I use the Print or Echo functions, in the double-quote form,
the control characters (i.e. \n,\r) have no effect on the text output.
For example, thee two will have the same output on my display:
(a) print("Hello World!\nHow are you ?")
(b) print("Hello World!How are you?")
Thanks,
Gurson.
Control Characters Having no Effect
Moderator: General Moderators
Re: Control Characters Having no Effect
Look in the source code of created page. HTML ignores spaces..Gurson wrote:Hi,
I'm new to PHP.
I tried to find answers to these on the web, but couldn't find such.
I use PHP 5.2 on Win XP, Abyss and KFWS servers.
When I use the Print or Echo functions, in the double-quote form,
the control characters (i.e. \n,\r) have no effect on the text output.
For example, thee two will have the same output on my display:
(a) print("Hello World!\nHow are you ?")
(b) print("Hello World!How are you?")
Thanks,
Gurson.
put '<pre>' and '</pre>' around that and see what happens.
-Zoxive
Apart from <pre> you could also have a look at http://www.php.net/nl2br. Btw, this is not the right forum to ask stuff like this.