You need to ask general questions, such as this question, at
[EMAIL PROTECTED] This php-doc list is not for general questions.
However, I have included an answer below. 

In a message dated 5/21/2004 6:37:49 AM Pacific Daylight Time,
[EMAIL PROTECTED] writes:

>I have a slight problem with the PHP compiler (?). I downloaded and
>installed SWAMP 0.2. But when printing (strings, arrays or whatever) they
>are all printed in the same line.
>eg :
>$array = array(1, 2, 3, 4, 5);
>print_r($array);
>
>outputs : Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 ) 
>
>or when printing strings, "\n" is translated as a single space.
>or even if I have 2 or more echo functions, they are printed in the same
>line without even a space between them.
>
>Can you help me on this issue? Have i to download a newer version of PHP?
>I'm using MSIE 6.0
>

I suspect that what you show as the output here is the output on a web page.
That is not the same thing as the output from PHP. In your browser, look at
the source of the web page and you will see the actual output of PHP. Then,
the browser interprets that output as HTML to display the web page. You need
to include the correct HTML code in your print statements to get the output
to look the way you want it to on the web page. For instance, I suspect the
following code will get the output you expect:

echo "<pre>";
print_r($array);
echo "<pre>";

As far as \n, only PHP understands this code, not HTML. \n means start a new
line in the PHP output. However, new lines are mainly ignored by HTML. If you
want to start a new line in HTML, you need to include <br>.

Janet

___________________________________
Janet Valade, author
PHP & MySQL for Dummies, Second Edition
PHP 5 for Dummies

Reply via email to