fwrite vanaf een bepaald punt in txt-file

Status
Niet open voor verdere reacties.

geertd

Gebruiker
Lid geworden
16 nov 2008
Berichten
340
Hallo allemaal,

Ik gebruik dit tekst (.txt) bestand voor een gastenboek:
Code:
[I][B][U]HIER[/U][/B][/I]<br><font face="Trebuchet MS"><table border="3" width="100%" bordercolor="#0000CC" style="border-collapse: collapse"><tr><td width="104" bgcolor="#FFFF99"><font face="Trebuchet MS">Naam</font></td><td><a href="mailto:EMAIL">NAAM</a></font></td></tr><tr><td width="104" bgcolor="#FFFF99">Bericht</td><td>BERICHT</td></tr><tr><td width="104" bgcolor="#FFFF99">Datum bericht</td><td><i>12-04-10 17:31</i></td></tr></table></font><br><font face="Trebuchet MS"><table border="3" width="100%" bordercolor="#0000CC" style="border-collapse: collapse"><tr><td width="104" bgcolor="#FFFF99"><font face="Trebuchet MS">Naam</font></td><td><a href="mailto:EMAIL2">NAAM2</a></font></td></tr><tr><td width="104" bgcolor="#FFFF99">Bericht</td><td>BERICHT2</td></tr><tr><td width="104" bgcolor="#FFFF99">Datum bericht</td><td><i>12-04-10 17:31</i></td></tr></table></font>
Hoe kan ik met een fwrite functie ervoor zorgen dat de tekst niet achter de andere tekst wordt geplakt, maar op het punt waar HIER staat?

Alvast bedankt,

Geert
 
Ik heb het al hiermee opgelost:

PHP:
$file = "gastenboekdatabase.txt"
$newmessage = $message
$content = file_get_contents('gastenboekdatabase.txt');
fwrite($file, "$newmessage"."\r\n"."$content");

met \r\n dus.

Toch bedankt,

Geert
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan