[PHP] /n not working

2003-07-26 Thread Thomas Hochstetter
Hi there.

I got a question from someone why the following (from the manual) will not
bring the desired output:

?php

/* if I open the following txt file and in explorer*/


$text = The quick brown fox jumped over the lazy dog.;
$newtext = wordwrap($text, 20);

echo $newtext\n;



/*my output is the following

The quick brown fox jumped over the lazy dog.

*/


/*this should however have the following output according to the php manual

The quick brown fox
jumped over the
lazy dog.

*/
?

Is this a php.ini setting?

Thomas


-- 
+++ GMX - Mail, Messaging  more  http://www.gmx.net +++

Jetzt ein- oder umsteigen und USB-Speicheruhr als Prämie sichern!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] /n not working

2003-07-26 Thread John W. Holmes
Thomas Hochstetter wrote:

Hi there.

I got a question from someone why the following (from the manual) will not
bring the desired output:
?php

/* if I open the following txt file and in explorer*/

$text = The quick brown fox jumped over the lazy dog.;
$newtext = wordwrap($text, 20);
echo $newtext\n;



/*my output is the following

The quick brown fox jumped over the lazy dog.

*/

/*this should however have the following output according to the php manual

The quick brown fox
jumped over the
lazy dog.
*/
?
Is this a php.ini setting?
HTML does not render newlines. You need to use br /. View the source 
of this code in your browser and you'll see everything is on it's own line.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] /n not working

2003-07-26 Thread Curt Zirzow
* Thus wrote John W. Holmes ([EMAIL PROTECTED]):
 Thomas Hochstetter wrote:
 
 $text = The quick brown fox jumped over the lazy dog.;
 $newtext = wordwrap($text, 20);
 
 echo $newtext\n;
  [...]

 HTML does not render newlines. You need to use br /. View the source 
 of this code in your browser and you'll see everything is on it's own line.
 

Yes the documentation is a little misleading. I'm in the process of
getting that changed in the documentation.

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] /n not working

2003-07-26 Thread DvDmanDT
I must suggest to just add like

header(Content-Type: text/plain); // Don't use HTML

To the top of examples like that...
-- 
// DvDmanDT
MSN: [EMAIL PROTECTED]
Mail: [EMAIL PROTECTED]
Curt Zirzow [EMAIL PROTECTED] skrev i meddelandet
news:[EMAIL PROTECTED]
 * Thus wrote John W. Holmes ([EMAIL PROTECTED]):
  Thomas Hochstetter wrote:
  
  $text = The quick brown fox jumped over the lazy dog.;
  $newtext = wordwrap($text, 20);
  
  echo $newtext\n;
   [...]
 
  HTML does not render newlines. You need to use br /. View the source
  of this code in your browser and you'll see everything is on it's own
line.
 

 Yes the documentation is a little misleading. I'm in the process of
 getting that changed in the documentation.

 Curt
 -- 
 I used to think I was indecisive, but now I'm not so sure.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] \n not working

2001-09-16 Thread alpherjo

I am just learning PHP. I have it installed on my Win 2000 IIS to practice,
and after I save PHP files in my wwwroot folder, I go ahead and access my
practice pages through IE via my full (universal) server address. However,
the \n code (to start a new line) never works. Any ideas?
Thanks!



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] \n not working

2001-09-16 Thread Andrew Brampton

Browsers don't parse \n as a new line, try using br which will make a new
line

Andrew
- Original Message -
From: alpherjo [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, September 16, 2001 9:51 PM
Subject: [PHP] \n not working


 I am just learning PHP. I have it installed on my Win 2000 IIS to
practice,
 and after I save PHP files in my wwwroot folder, I go ahead and access my
 practice pages through IE via my full (universal) server address. However,
 the \n code (to start a new line) never works. Any ideas?
 Thanks!



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]