This is a discussion on "Fwrite with new line break problem?" within the PHP Forum section. This forum, and the thread "Fwrite with new line break problem? are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Fwrite with new line break problem?
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Fwrite with new line break problem?
Hi People,
If anyone can help me please? Im trying to write to a txt file and create a new line break from the code i submit. This is what i'm using as an example: $myFile = "test.txt"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = "Bobby\n"; fwrite($fh, $stringData); $stringData = "Pointy\n"; fwrite($fh, $stringData); fclose($fh); But when i open the .txt file i end up with: BobbyPointy Any suggestions please? Cheers! |
|
|
|
||||
|
Re: Fwrite with new line break problem?
Are you on a windows system?
If you are, you may need to write $string = "Bobby\r\n"; As windows handles new lines a bit differently. Try that and see if it works
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [solved] I want to insert a line break | minute44 | PHP Forum | 4 | Feb 20th, 2008 12:52 |
| prevent line break after a checkbox | pesho318i | Web Page Design | 7 | Feb 6th, 2008 09:34 |
| Blank line problem | dartiss | Web Page Design | 8 | Aug 6th, 2007 21:28 |
| Line Break | DregondRahl | Web Page Design | 6 | Jun 12th, 2007 15:33 |
| <div> function without the line break | Tim356 | Web Page Design | 10 | Sep 27th, 2004 18:39 |