propiere auch schon ganz schön lange herum!
und nun hab ichs auch hinbekommen:
function input_to_output()
{
if (!empty($_REQUEST['input']) && !isset($_REQUEST['options'])) {
$textfile = @fopen("text.txt", "a+");
fwrite($textfile, $_REQUEST['nick']. ": ". $_REQUEST['input']. "\r\n");
unset($_REQUEST['input']);
}
else {
$reset = 10;
$textfile = file("text.txt");
unset($textfile[$reset]);
$set = implode($textfile);
$textfile = @fopen("text.txt", "w+");
fwrite($textfile, $set);
echo $_REQUEST['output'];
}
$textfile = file("text.txt");
foreach ($textfile as $line => $_REQUEST['output']) {
if ($line < 9) {
echo $_REQUEST['output'];
continue;
}
else {
$reset = 0;
$textfile = file("text.txt");
unset($textfile[$reset]);
$set = implode($textfile);
$textfile = @fopen("text.txt", "w+");
fwrite($textfile, $set);
echo $_REQUEST['output'];
break;
}
}
}