Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP
Author Message
irandoct
Hangin' Around



Joined: Dec 01, 2003
Posts: 39

PostPosted: Wed Nov 17, 2004 3:17 am Reply with quote

I'm trying to write to a file using php. I have some values to be write. How can I create new lines in the file and put each value in a separate line ? I'm using fputs function :

Quote:
$fp = fputs($handle, $rthis);
$fp = fputs($handle2, $passfile);
$fp = fputs($handle2, $passfile2);

I need $passfile, $passfile2 write in separate lines!
Please help me !
 
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Wed Nov 17, 2004 6:13 am Reply with quote

Code:
$newline = "\n";

$fp = fputs($handle, $rthis);
$fp = fputs($handle2, $passfile.$newline);
$fp = fputs($handle2, $passfile2.$newline);


On windows you may want to use \r\n instead of just \n
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©