PHP Code:
temp.lines = {
"first line",
"second line",
"third line"
};
// if you want to append to the file instead of replacing, second parameter
// should be true
temp.lines.saveLines("path/to/file.txt", false);
Serverside, obviously, and (npcserver) needs rw (folder rights) to the specified file.
To get an array of lines from a text file,
PHP Code:
temp.lines.loadLines("path/to/file.txt");