Carriage return

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
spacebiscuit
Forum Contributor
Posts: 390
Joined: Mon Mar 07, 2005 3:20 pm

Carriage return

Post by spacebiscuit »

Hi,

I am not sure if this is a PHP question as such but I am not sure where else o post it.

I am working on a .passwd file and it seems that each username and passord combination is on its own line.

I am adding to the password file and I want to know how I add a line with the carriage return character.

I am using PHP to edi the file by the way.

Many thanks in advance,

Rob.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Code: Select all

$carriage_return = "\r\n";

$line_feed = "\n";
You're probably just looking for a line feed. Windows uses two bytes for a new line, a carriage return and a new line byte.
Post Reply