Jump to content

[SOLVED] Add something to a text file?


papaface

Recommended Posts

Hi,

 

Open the file in append mode and fwrite. Here's the example.

 

<?php

$myString = "Some text";

$fh=fopen('test.txt',"a");

fwrite($fh,$myString);

fclose($fh);

?>

 

Make sure to set appropriate permissions to the file test.txt so that PHP can open it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.