file_exists.php
fputs.php
file_getc.php
Php.net