I'm creating a file by reading one using the file(file.txt)
I'm using a for loop to pull out only X lines from the original file and then writing them to the new file.
Strange thing is in the original file each line is directly underneath the previous on
e.g
Line 1
Line 2
Line 3
However when i write the lines to the new file they have a space inbetween then
e.g
line 1
line 2
line 3
What is the reason for the extra lines?
Here is my code for you to laugh at 😃
$session_data = file($file); <- original file
$fp1 = fopen("cookie.txt","w+"); <- new file
for($i=6;$i<10;$i++)
{
fwrite($fp1,$session_data[$i]);
}
fclose($fp1);
Cheers guys
GM