Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

weird things
I posted the question earlier about the variables in the select statement
(still doesn't work) I just noticed something else, \n does not work either.
Ex.
<?php echo("this is line 1\n");
echo("this is line 2\n");
?>
the output however looks like this:
this is line 1 this is line 2

Is this some configuration issue?
I am using Win2K Pro with the XAMPP package v 1.3
php 4.3.4
apache 2.0.48

any help clearing up this mystery would be greatly appreciated so I can get
on learning php.

TIA,
jrg




Report this thread to moderator Post Follow-up to this message
Old Post
jg
03-27-04 04:13 AM


Re: weird things
"jg" <jrg@nospam-weirdcat.com> wrote in message
news:%3_7c.413$eh7.262@news01.roc.ny...
> I posted the question earlier about the variables in the select statement
> (still doesn't work) I just noticed something else, \n does not work
either.
> Ex.
> <?php echo("this is line 1\n");
>  echo("this is line 2\n");
> ?>
> the output however looks like this:
>  this is line 1 this is line 2
>
> Is this some configuration issue?
> I am using Win2K Pro with the XAMPP package v 1.3
> php 4.3.4
> apache 2.0.48
>
> any help clearing up this mystery would be greatly appreciated so I can
get
> on learning php.
>
> TIA,
> jrg
>
>
>

/n (new line) will only work for raw output - like PHP command line.
It will also work if you "view source" in notepad or something.

But,  \n means nothing to a browser that is looking for HTML tags. It will
be treated as a blank space (I think)
Use the HTML break <br>




Report this thread to moderator Post Follow-up to this message
Old Post

03-27-04 04:13 AM


Re: weird things
*** jg wrote/escribió (Tue, 23 Mar 2004 17:01:47 GMT):
> <?php echo("this is line 1\n");
>  echo("this is line 2\n");
> ?>
> the output however looks like this:
>  this is line 1 this is line 2
>
> Is this some configuration issue?

HTML is defined that way: carriage returns are ignored. If you want to
convert carriage returns into HTML tags you need nl2br().


--
--
-- Álvaro G. Vicario - Burgos, Spain
--

Report this thread to moderator Post Follow-up to this message
Old Post
Alvaro G Vicario
03-27-04 04:13 AM


Re: weird things
Thanks Nikola, that's what I've been doing but couldn't figure out why the
examples from the manual won't work for me.

jrg

<Nikola Tesla> wrote in message news:qM6dnckL1LAM7f3dRVn-uw@comcast.com...
>
> "jg" <jrg@nospam-weirdcat.com> wrote in message
> news:%3_7c.413$eh7.262@news01.roc.ny... 
statement 
> either. 
> get 
>
> /n (new line) will only work for raw output - like PHP command line.
> It will also work if you "view source" in notepad or something.
>
> But,  \n means nothing to a browser that is looking for HTML tags. It will
> be treated as a blank space (I think)
> Use the HTML break <br>
>
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
jg
03-27-04 04:13 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 03:51 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.