Answers for "php open txt file options write"

PHP
1

php file read

<?php
  echo file_get_contents("text.txt");
?>
Posted by: Guest on November-17-2020
3

php write to file

$myFile = "testFile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "Bobby Bopper\n";
fwrite($fh, $stringData);
$stringData = "Tracy Tanner\n";
fwrite($fh, $stringData);
fclose($fh);
Posted by: Guest on February-24-2020

Browse Popular Code Answers by Language