×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Fabian Constien
Added: Nov 21, 2017 5:13 AM
Views: 2577
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;