hey i am inserting a content ont he top of my txt file
my current text file is like this
- f sdjkhfkdjlshfdjkls
- hjkfdhfklsdjh fklsdhklfsd
- jkfhdkjlfh sdkfhdskl
- jklhfdjlh dfskhfsdl
and i wanna insert somethign on the first like and it should output like this
- jkfdh fklsdhlfksd
- f sdjkhfkdjlshfdjkls
- hjkfdhfklsdjh fklsdhklfsd
- jkfhdkjlfh sdkfhdskl
- jklhfdjlh dfskhfsdl
but i just use the process like this
$MESSAGE = '0. jkfdh fklsdhlfksd\n';
$lines = file( $PATH.$FILE );
foreach ($lines as $line_num => $line) {
if($line_num < 14){
$MESSAGE .= $line;
}
}
$filetarget = fopen("$FULLFILE", "w+");
fputs($filetarget, $MESSAGE);
fclose($filetarget);
the \n is not working.. it should put the 1. on the bottom of the 0 right after putting the \n command. but it does not what dou think should be the problem here?
any 1 knows how to handle this kind of situation?
by the way i am currently using a winodws webserver as my testing server.. but i am going to upload this into a linux box after finishing everything.
thank you in advance.