×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Andreas Lindner
Added: Jan 24, 2018 3:56 PM
Views: 2716
Tags: no tags
  1. $xyzFile = '/tmp/test.txt';
  2. // write
  3. $xyzFileHandle = fopen($xyzFile, "a+");
  4. fwrite($xyzFileHandle, 'test 1 2 3 ...' . "\n");
  5. fclose($xyzFileHandle);
  6. // read
  7. $xyzFileContent = file_get_contents($xyzFile);
  8. // output
  9. echo 'content: ' . $xyzFileContent;