rewind and fseek
<?
$filename = 'data.txt';
$handle = fopen($filename, "w+");
fwrite($handle, "Mnnkyys\n");
rewind($handle);
fseek($handle, 1);
fwrite($handle, "o");
fseek($handle, 2, SEEK_CUR);
fwrite($handle, "e");
fclose($handle);
?>
Related examples in the same category