How to put text to the next line in file?
I have a cycle "for". In this cycle i need to write a text, and in next cycle, need to place text to next line. Not replace existing. I tried to format with ^n at end. Tried to fputs, fprintf, but nothing changes. help
|
Re: How to put text to the next line in file?
if you ment what I think you ment you can put a bool to check whenever is the second/third etc. return.
|
Re: How to put text to the next line in file?
Well, i'm thank abou this. Bui i dont care how to check is that next line:) So can someone help me.
PS I dont scripting about half year. So i'm totally forgot about operators and functions :):) |
Re: How to put text to the next line in file?
Just use write_file() and don't specify a line.
|
Re: How to put text to the next line in file?
You dont care ? Did you mean you dont know O.o
PHP Code:
|
Re: How to put text to the next line in file?
Those are 5 returns and your code switches from one code to another, it doesn't stop at the second 'line' since you're setting that to false again.
And if you just want to add multiple lines with multiple different content you don't need any loop... just use fopen() and fprint() or just write_file() and it will write the data on a new line. |
Re: How to put text to the next line in file?
Problem Solved! Thanks to all!
|
Re: How to put text to the next line in file?
You should be able to append with the fopen(), fputs(), and fprintf() functions. I think you just need to open it with flag "a" instead of "w".
|
| All times are GMT -4. The time now is 21:51. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.