- fwrite: documentation ( source)
- ftell: documentation ( source)
- fseek: documentation ( source)
- fread: documentation ( source)
- fopen: documentation ( source)
<?php
$fp = fopen('/tmp/test.txt', 'a+');
fwrite($fp, 'foo');
echo ftell($fp);
fseek($fp, 0);
fwrite($fp, 'bar');
echo ftell($fp);
echo fread($fp, 3);
fseek($fp, 0);
echo fread($fp, 6);