pzieye Posted November 23, 2008 Share Posted November 23, 2008 hey.sorry for the dumb question but I've only started studying PHP today.I need to write a string on a file and I'm using file_put_contents().problem is, I need what I write to be in the following line of the already existant strings.exampletest.txt:test1I'm using file_put_contents("test.txt","test2",FILE_APPEND); but it goes like this:test.txt:test1test2when I wanted like this:test.txt:test1test2How can I do it this way? Thanks Link to comment Share on other sites More sharing options...
jeffman Posted November 23, 2008 Share Posted November 23, 2008 The function does exactly what you tell it. If you want a new line, you need to feed it a newline character:file_put_contents("test.txt", "\ntest2", FILE_APPEND); Link to comment Share on other sites More sharing options...
pzieye Posted November 23, 2008 Author Share Posted November 23, 2008 The function does exactly what you tell it. If you want a new line, you need to feed it a newline character:file_put_contents("test.txt", "\ntest2", FILE_APPEND); ty Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.