How do I add an end line so that my next entry goes on the next line?
fwrite($file, $entry);
I need to add the end line after $entry...
How to write an end line to a file?
Moderator: General Moderators
-
slipstream
- Forum Commoner
- Posts: 86
- Joined: Fri Apr 19, 2002 8:53 am
- Location: Canada
- puckeye
- Forum Contributor
- Posts: 105
- Joined: Fri Dec 06, 2002 7:26 pm
- Location: Joliette, QC, CA
- Contact:
Use the \n (that's blackslash n) to create a newline.
EDIT: Inside your string I mean, so with the string you have in the other thread you'd have :
EDIT: Inside your string I mean, so with the string you have in the other thread you'd have :
Code: Select all
<?php
$work_str = $name."|".$hours."|".$date."|".$comments."\n";
?>-
slipstream
- Forum Commoner
- Posts: 86
- Joined: Fri Apr 19, 2002 8:53 am
- Location: Canada
ok
but how can I concatonate that to the end of my entry, I tried this but it doesn't work:
fwrite($file, $entry\n);
fwrite($file, $entry\n);
- puckeye
- Forum Contributor
- Posts: 105
- Joined: Fri Dec 06, 2002 7:26 pm
- Location: Joliette, QC, CA
- Contact:
Re: ok
Instead use:slipstream wrote:but how can I concatonate that to the end of my entry, I tried this but it doesn't work:
fwrite($file, $entry\n);
Code: Select all
<?php
fwrite($file, $entry."\n");
?>