RE: [PHP] How to implode with carraige return ?

2002-05-23 Thread Martin Towell

unix uses just \n  ( chr(13) )
windows uses \r\n  ( chr(10).chr(13) )

try changing \n\r to \r\n

HTH
Martin


-Original Message-
From: Manisha [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 24, 2002 1:35 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How to implode with carraige return ?


I have 3 elements in an array

$arr[1] =  1 | Manisha ;
$arr[2] =  2 | Milind ;
$arr[3] =  3 | Aish ;

I want to implode it to string first and later on want to write in to txt 
file.

I tried to implode  this chr(13) as a separator. I tried with $arr[1] = 1 
| Manisha \n\r as an array element.

But I do not see new line, instead I see small square box.

Server environment - Unix - PHP4
I see file after ftp to my computer (Win 98)

Thanks in advance
Manisha



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

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




RE: [PHP] How to implode with carraige return ?

2002-05-23 Thread Manisha

Yes, you were write - when I used chr(10).chr(13) - it worked.

But still little bit confused. When you are saying unix uses \n, that means 
if I am reading the file from unix server - it would have looked ok, but 
the same file won't look good if I open in Windows ?

I always gets confuse here.

Thanks,
Manisha

At 01:46 PM 5/24/02 +1000, Martin Towell wrote:
unix uses just \n  ( chr(13) )
windows uses \r\n  ( chr(10).chr(13) )

try changing \n\r to \r\n

HTH
Martin


-Original Message-
From: Manisha [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 24, 2002 1:35 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How to implode with carraige return ?


I have 3 elements in an array

$arr[1] =  1 | Manisha ;
$arr[2] =  2 | Milind ;
$arr[3] =  3 | Aish ;

I want to implode it to string first and later on want to write in to txt
file.

I tried to implode  this chr(13) as a separator. I tried with $arr[1] = 1
| Manisha \n\r as an array element.

But I do not see new line, instead I see small square box.

Server environment - Unix - PHP4
I see file after ftp to my computer (Win 98)

Thanks in advance
Manisha



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


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




RE: [PHP] How to implode with carraige return ?

2002-05-23 Thread Miguel Cruz

On Fri, 24 May 2002, Manisha wrote:
 Yes, you were write - when I used chr(10).chr(13) - it worked.
 
 But still little bit confused. When you are saying unix uses \n, that means 
 if I am reading the file from unix server - it would have looked ok, but 
 the same file won't look good if I open in Windows ?

It depends on how you transfer the file. If you use ASCII-mode FTP, a 
text/* MIME content type, or some other text-aware method, then the \n 
will automatically be changed to \r\n when you transfer the file.

If you use a binary or other literal transfer, then you'll have to convert 
the line breaks yourself (or view the file using a tool that's smart 
enough not to care, such as most programmer's editors).

miguel


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




RE: [PHP] How to implode with carraige return ?

2002-05-23 Thread Manisha

Thanks Miguel

Manisha


At 12:02 AM 5/24/02 -0500, Miguel Cruz wrote:
On Fri, 24 May 2002, Manisha wrote:
  Yes, you were write - when I used chr(10).chr(13) - it worked.
 
  But still little bit confused. When you are saying unix uses \n, that 
 means
  if I am reading the file from unix server - it would have looked ok, but
  the same file won't look good if I open in Windows ?

It depends on how you transfer the file. If you use ASCII-mode FTP, a
text/* MIME content type, or some other text-aware method, then the \n
will automatically be changed to \r\n when you transfer the file.

If you use a binary or other literal transfer, then you'll have to convert
the line breaks yourself (or view the file using a tool that's smart
enough not to care, such as most programmer's editors).

miguel


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