Re: [PHP] ^M at the end of each line when I use php to write file

2002-11-01 Thread Gerard Samuel
Im not sure, but I believe Ive noticed this when I fopen() a file with
the 'b' value like fopen($foo, 'wb');
I may be totally wrong...


Brandon Orther wrote:


Hello,

Does anyone know a way around all the ^M at the end of each line that my
php file writes to on a linux box?


 

Brandon Orther 

WebIntellects Design/Development Manager

 [EMAIL PROTECTED]
800-994-6364

 www.webintellects.com





 


--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/




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




RE: [PHP] ^M at the end of each line when I use php to write file

2002-10-31 Thread Brandon Orther
Hello,

For anyone else that had a problem with ^M use this function:

str_replace("\r", "", $result);

 
Brandon Orther 
WebIntellects Design/Development Manager
[EMAIL PROTECTED] 800-994-6364
www.webintellects.com




-Original Message-
From: 1LT John W. Holmes [mailto:holmes072000@;charter.net] 
Sent: Thursday, October 31, 2002 10:42 AM
To: Brandon Orther; PHP User Group
Subject: Re: [PHP] ^M at the end of each line when I use php to write
file


You're probably writing \r\n instead of just \n. 

---John Holmes...

- Original Message - 
From: "Brandon Orther" <[EMAIL PROTECTED]>
To: "PHP User Group" <[EMAIL PROTECTED]>
Sent: Thursday, October 31, 2002 12:44 PM
Subject: [PHP] ^M at the end of each line when I use php to write file


> Hello,
>  
> Does anyone know a way around all the ^M at the end of each line that 
> my php file writes to on a linux box?
>  
> 
> 
> 
> Brandon Orther
> 
> WebIntellects Design/Development Manager
> 
>  <mailto:brandon@;webintellects.com> [EMAIL PROTECTED] 
> 800-994-6364
> 
>  <http://www.webintellects.com/> www.webintellects.com
> 
> 
> 
>  
> 


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




Re: [PHP] ^M at the end of each line when I use php to write file

2002-10-31 Thread Marek Kilimajer
Don't put it into the databese ;)


Brandon Orther wrote:


The lines that are having a ^M are pulling from a TEXT field of a mysql
database.  The \n I am saving come out great.  So I guess I found that
my issue is that text fields I am pulling.  Is there a way to make the
new line in a text field the same as a \n when pulling from a database?

 
Brandon Orther 
WebIntellects Design/Development Manager
[EMAIL PROTECTED] 800-994-6364
www.webintellects.com




-Original Message-
From: Evan Nemerson [mailto:evan@;coeus-group.com] 
Sent: Thursday, October 31, 2002 10:08 AM
To: Brandon Orther; [EMAIL PROTECTED]
Subject: Re: [PHP] ^M at the end of each line when I use php to write
file


a what does your code look like??? What happens when you

$fp = fopen("temp", a+);
for ( $x=0 ; $x<10 ; $x++ )
	fputs($fp, "$x\n");
fclose($fp);

???



On Thursday 31 October 2002 09:44 am, Brandon Orther wrote:
 

Hello,

Does anyone know a way around all the ^M at the end of each line that 
my php file writes to on a linux box?




Brandon Orther

WebIntellects Design/Development Manager

<mailto:brandon@;webintellects.com> [EMAIL PROTECTED] 
800-994-6364

<http://www.webintellects.com/> www.webintellects.com


   


 



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




Re: [PHP] ^M at the end of each line when I use php to write file

2002-10-31 Thread 1LT John W. Holmes
You're probably writing \r\n instead of just \n. 

---John Holmes...

- Original Message - 
From: "Brandon Orther" <[EMAIL PROTECTED]>
To: "PHP User Group" <[EMAIL PROTECTED]>
Sent: Thursday, October 31, 2002 12:44 PM
Subject: [PHP] ^M at the end of each line when I use php to write file


> Hello,
>  
> Does anyone know a way around all the ^M at the end of each line that my
> php file writes to on a linux box?
>  
> 
>  
> 
> Brandon Orther 
> 
> WebIntellects Design/Development Manager
> 
>  <mailto:brandon@;webintellects.com> [EMAIL PROTECTED]
> 800-994-6364
> 
>  <http://www.webintellects.com/> www.webintellects.com
> 
> 
> 
>  
> 

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




RE: [PHP] ^M at the end of each line when I use php to write file

2002-10-31 Thread Brandon Orther
The lines that are having a ^M are pulling from a TEXT field of a mysql
database.  The \n I am saving come out great.  So I guess I found that
my issue is that text fields I am pulling.  Is there a way to make the
new line in a text field the same as a \n when pulling from a database?

 
Brandon Orther 
WebIntellects Design/Development Manager
[EMAIL PROTECTED] 800-994-6364
www.webintellects.com




-Original Message-
From: Evan Nemerson [mailto:evan@;coeus-group.com] 
Sent: Thursday, October 31, 2002 10:08 AM
To: Brandon Orther; [EMAIL PROTECTED]
Subject: Re: [PHP] ^M at the end of each line when I use php to write
file


a what does your code look like??? What happens when you

$fp = fopen("temp", a+);
for ( $x=0 ; $x<10 ; $x++ )
fputs($fp, "$x\n");
fclose($fp);

???



On Thursday 31 October 2002 09:44 am, Brandon Orther wrote:
> Hello,
>
> Does anyone know a way around all the ^M at the end of each line that 
> my php file writes to on a linux box?
>
>
> 
>
> Brandon Orther
>
> WebIntellects Design/Development Manager
>
>  <mailto:brandon@;webintellects.com> [EMAIL PROTECTED] 
> 800-994-6364
>
>  <http://www.webintellects.com/> www.webintellects.com
>
> 

-- 
I contend that we are both atheists. I just believe in one fewer god
than you 
do. When you understand why you dismiss all the other possible gods, you
will 
understand why I dismiss yours.

-Stephen Roberts


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




Re: [PHP] ^M at the end of each line when I use php to write file

2002-10-31 Thread Evan Nemerson
a what does your code look like??? What happens when you

$fp = fopen("temp", a+);
for ( $x=0 ; $x<10 ; $x++ )
fputs($fp, "$x\n");
fclose($fp);

???



On Thursday 31 October 2002 09:44 am, Brandon Orther wrote:
> Hello,
>
> Does anyone know a way around all the ^M at the end of each line that my
> php file writes to on a linux box?
>
>
> 
>
> Brandon Orther
>
> WebIntellects Design/Development Manager
>
>   [EMAIL PROTECTED]
> 800-994-6364
>
>   www.webintellects.com
>
> 

-- 
I contend that we are both atheists. I just believe in one fewer god than you 
do. When you understand why you dismiss all the other possible gods, you will 
understand why I dismiss yours.

-Stephen Roberts


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




[PHP] ^M at the end of each line when I use php to write file

2002-10-31 Thread Brandon Orther
Hello,
 
Does anyone know a way around all the ^M at the end of each line that my
php file writes to on a linux box?
 

 

Brandon Orther 

WebIntellects Design/Development Manager

  [EMAIL PROTECTED]
800-994-6364

  www.webintellects.com