Answers for "print in file php"

PHP
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
0

php get and print file contents

<?php
// Read 14 characters starting from the 21st character
$section = file_get_contents('./people.txt', FALSE, NULL, 20, 14);
var_dump($section);
?>
Posted by: Guest on July-21-2021

Browse Popular Code Answers by Language