I'am putting the codes right but there seems to be a problem.. i'am using the following codes to write to the file:
<?php$myFile = "testfile.txt";$fh = fopen($myFile, 'w');$datastring = "text 1\n";fwrite($fh,$datastring);$datastring = "text2\n";fwrite($fh,$datastring);fclose($fh);?>
and the following to read it:
<?php$myFile = "testfile.txt";$fh = fopen($myFile, 'r');$theData = fread($fh, filesize($myFile));fclose($fh);echo $theData;?>
But instead of separate lines, its displaying the file contents in the same line, thats what i was trying to figure out..