I am working on something that will allow you to modify a file's contents using an html form.
If I start a new line in the textarea, when I go back to modify the file, there is a blank line between the first line and the new line... example:
originally:
Hello
modding:
Hello
World
reloaded:
Hello
World
so it seems to be adding in extra "\n"s and I don't know why. I have tried using $contents=file();
for($i=0; $i<count($contents); $i++){
$trim($contents[$i], "\n");
}
and other things, including imploding the $contents array into one string (using the example for loading a file into a string in the manual under file()), but nothing seems to be working. I am not sure if it is happening when I actually write the file, or when it loads the file into the textarea.
anyone have any ideas?
thanks,
Paddy