PHP: Append to text file

Here is an example how to open and append to a text file:

$file = 'log.txt';
$current = file_get_contents($file);

$current.="This is my log message";

file_put_contents($file, $current);

Werbung



comments powered by Disqus

Copyright Dunkel & Iwer GbR | Datenschutzerklärung | Impressum