- file_put_contents: documentation ( source)
- fclose: documentation ( source)
- fwrite: documentation ( source)
- fread: documentation ( source)
- fopen: documentation ( source)
- filesize: documentation ( source)
<?php
$f = fopen("data1.txt",'r+') or die("Error");
//echo fread($f, 5);
//echo fread($f, 3);
$s = filesize("data1.txt");
echo fread($f, $s);
fwrite($f,'ksdhfkjsdf');
echo fread($f, $s+10);
file_put_contents("data1.txt",'\n1234567890',FILE_APPEND);
echo fread($f, $s+30);
fclose($f);
?>