"Zeilenumbruch" in .txt dateien

Morph

Erfahrenes Mitglied
Also
Ich würd gern die durch ein Formular eingegebenen variablen in einer reihe speichern (is ja net sonderlich schwer *G*)

Wie mache ich es dann aber den nächsten datensatz in eine neue zeile zu schreiben ? und den darauffolgenden auch in eine neue ?

Bsp:

UserName1 || Passwort1
UserName2 || Passwort2
UserName3 || ...

Funzt des mit a+ ? oder doch nicht weil das ende der datei ja eigentlich noch in der ersten zeile ist ?

Bin da im mom echt am grübeln ...

Grüße, Morph
 
Das legst du beim öffnen von Dateien fest:

'r' - Open for reading only; place the file pointer at the beginning of the file.

'r+' - Open for reading and writing; place the file pointer at the beginning of the file.

'w' - Open for writing only; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it.

'w+' - Open for reading and writing; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it.

'a' - Open for writing only; place the file pointer at the end of the file. If the file does not exist, attempt to create it.

'a+' - Open for reading and writing; place the file pointer at the end of the file. If the file does not exist, attempt to create it.


In deinem Fall brauchst a
 
Hast mich sicher falsch verstanden - ist aber jetzt eh egal. Hab das, was ich gesucht hab schon gefunden.
Nämlich wenn ich eine Variable in ner textdatei mit fwrite
speicher, wie ich dann in der datei sofort nen zeilenumbruch hinbekomm ... -> fwrite(..., "$blub\n");
Darauf bin ich einfach net gekommen ... deshalb hab ich ma angefragt

Grüße, Morph
 
ACHSOOOOO :p
Sorry, mein Fehler. Habe dich wirklich falsch verstanden. OK, aber wenn dein Problem gelöst ist, dann ist uns beiden geholfen :)
 
Hihi is ja schon cool dasde versuchst zu helfen ;)

btw: Ich muss mich immer wieder wegschmeißen, wenn ich dein userpic sehe :D

Grüße, Morph
 
Zurück