How to write in next line
-
$s=file('http://www.abc.com/d.txt'); $size=count($s); $ud = fopen("yaka.txt","w"); for($x=0;$x<$size;$x++) { $line =trim($s[$x]); fwrite($ud, $line); } I want to write in next line.how to do this. Example :- data is in .txt file 12,54,45 78,87,96 23,54,64 and i also want in same format but i am getting like this.... 12,54,4578,87,9623,54,64 What to do ? help me
-
$s=file('http://www.abc.com/d.txt'); $size=count($s); $ud = fopen("yaka.txt","w"); for($x=0;$x<$size;$x++) { $line =trim($s[$x]); fwrite($ud, $line); } I want to write in next line.how to do this. Example :- data is in .txt file 12,54,45 78,87,96 23,54,64 and i also want in same format but i am getting like this.... 12,54,4578,87,9623,54,64 What to do ? help me
udch wrote:
fwrite($ud, $line);
I may be rusty on my PHP, but I believe what you need to do is add a newline character to each line after you
fwrite
it. Perhaps something like this?fwrite($ud, $line . "\n");
Adam Maras | Software Developer Microsoft Certified Professional Developer
-
udch wrote:
fwrite($ud, $line);
I may be rusty on my PHP, but I believe what you need to do is add a newline character to each line after you
fwrite
it. Perhaps something like this?fwrite($ud, $line . "\n");
Adam Maras | Software Developer Microsoft Certified Professional Developer
-
$s=file('http://www.abc.com/d.txt'); $size=count($s); $ud = fopen("yaka.txt","w"); for($x=0;$x<$size;$x++) { $line =trim($s[$x]); fwrite($ud, $line); } I want to write in next line.how to do this. Example :- data is in .txt file 12,54,45 78,87,96 23,54,64 and i also want in same format but i am getting like this.... 12,54,4578,87,9623,54,64 What to do ? help me
-
Thanks for your help brother but it is not working it is only adding [] something like this may be space because it is not visible here.Thanks again for you help bro.
Which file viewer are you using ?