dedlfix: need help - php fopen

Beitrag lesen

echo $begrüßung;

before i write a new line in example.txt, i want to delete the entire contents first.

Did you read the content of the file before you are trying to write? The file pointer is now at the end of the file and needs to be repositioned to offset 0. Use fseek() or rewind().

how can i delete the contents?

To get rid of the old content an additional ftruncate() is needed.

echo "$verabschiedung $name";