There is no "prepend" mode... r+ lets you read and write any position within the file, and the file won't be automatically truncated.
If example.txt contains "aaaaaaaaaa" and you do this...
$fp = fopen('example.txt', 'r+');
fwrite($fp, 'bbbbb');
fclose($fp);
It will contain "bbbbbaaaaa".
