:queasy:
I added those changes. They didn't take any effect.
I did some thinking now, and I am pretty sure I know why it's happening, but I don't know how to fix it code-wise.
There are 3 lines in the text file.
Test
abcd
efgh
print("<br>$buffer");
Works in the first position because it is part of a loop. As the page is loading the value of $buffer is changed 3 times.
First it is set to "Test"
Then "Test" is printed, then the loop starts over.
$buffer is set to "abcd" and then "abcd" is printed, then $buffer is set to "efgh" and "efgh" is printed.
When I try and use
print("<br>$buffer");
Outside of the loop, the value of $buffer is still "efgh" and that is why only the last line is printed outside of the loop.
EDIT: I fixed the problem by pasting the loop into another .php file and putting it where I wanted with the include() function.
Thanks for the help!