Liam Gibbs wrote:
So which is it that will keep my files from having ^M after PHP is finished fopen(), fputs(), and fclose() with them? \n, \r, and \n\r all seem to reinsert ^M at the ends of all my lines.
It looks like you are viewing a dos/windows file on unix. The ^M is
carriage return,
It looks like you are viewing a dos/windows file on unix. The ^M is
carriage return, which is needed as part of a dos/window end of line
sequence (carriage return, line feed) whereas unix uses just line feed.
Nope. They're UNIX-created and UNIX-modified. Does it matter if I downloaded
them
\r shows up as ^M in many unix editors, so if you don't want ^M there,
don't put \r into the file
Liam Gibbs wrote:
It looks like you are viewing a dos/windows file on unix. The ^M is
carriage return, which is needed as part of a dos/window end of line
sequence (carriage return, line feed)
At 16:16 4-4-2003, you wrote:
It looks like you are viewing a dos/windows file on unix. The ^M is
carriage return, which is needed as part of a dos/window end of line
sequence (carriage return, line feed) whereas unix uses just line feed.
Nope. They're UNIX-created and UNIX-modified. Does it
Liam Gibbs wrote:
It looks like you are viewing a dos/windows file on unix. The ^M is
carriage return, which is needed as part of a dos/window end of line
sequence (carriage return, line feed) whereas unix uses just line feed.
Nope. They're UNIX-created and UNIX-modified. Does it matter if I
So which is it that will keep my files from having ^M after PHP is finished fopen(),
fputs(), and fclose() with them? \n, \r, and \n\r all seem to reinsert ^M at the ends
of all my lines.
On Friday 04 April 2003 14:38, Liam Gibbs wrote:
So which is it that will keep my files from having ^M after PHP is finished
fopen(), fputs(), and fclose() with them? \n, \r, and \n\r all seem to
reinsert ^M at the ends of all my lines.
1) Could you summarise what you're trying to do
2) Show
John W. Holmes wrote:
Yeah, I could use a decent text editor, but not everyone who uses my
site
will use it. I need something that can edit them out after download.
Wouldn't it be smarter to eliminate them before it was saved on Windows?
You could read in the file and get rid of all of the \r
I'm downloading a file from Windows to Linux through PHP. Understandably, there are
^Ms at the end of my lines. Is there a PHP function I can use to delete them?
I know there's a binary for doing exactly that in linux but I can't for the
life of me remember the name. If you're text editor is any good you should
be able to do a search and replace for \r with . I use joe, but that's
hardly the editor of choice for most.
Cheers,
Rob.
Liam Gibbs wrote:
Robert Cummings wrote:
I know there's a binary for doing exactly that in linux but I can't for the
life of me remember the name. If you're text editor is any good you should
be able to do a search and replace for \r with . I use joe, but that's
hardly the editor of choice for most.
Cheers,
Rob.
I'm downloading a file from Windows to Linux through PHP.
Understandably,
there are ^Ms at the end of my lines. Is there a PHP function I can
use to
delete them?
Use a decent text editor that'll save the files in Unix format... even
if you're on a PC.
Let's NOT get into a
Use a decent text editor that'll save the files in Unix format... even
if you're on a PC.
Yeah, I could use a decent text editor, but not everyone who uses my site
will use it. I need something that can edit them out after download.
--
PHP General Mailing List (http://www.php.net/)
To
Use a decent text editor that'll save the files in Unix format...
even
if you're on a PC.
Yeah, I could use a decent text editor, but not everyone who uses my
site
will use it. I need something that can edit them out after download.
Wouldn't it be smarter to eliminate them before it was
Use a decent text editor that'll save the files in Unix format... even
if you're on a PC.
Yeah, I could use a decent text editor, but not everyone who uses my site
will use it. I need something that can edit them out after download.
If you don't have that dos2unix conversion utility handy:
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?
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
a what does your code look like??? What happens when you
$fp = fopen(temp, a+);
for ( $x=0 ; $x10 ; $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
, 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 ; $x10 ; $x++ )
fputs($fp, $x\n);
fclose($fp
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
[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 ; $x10 ; $x
-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
List,
I've a RH7.3 machine (just installed) and want to get PHP to access my M$
SQL database. I'm on a small time crunch here too. My M$ web server
died and it's so hosed that I had to call support (ouch!).
Anyways...they haven't fixed it yet and I thought it would be funny to
get
23 matches
Mail list logo