I\'ve got an simple php script, wich creates a file, add some content and closes it again. But my host disabled the fopen function. I was wondering how I could get around th
//to write
file_put_contents('path_and_filename','content');
//to read:
file_get_contents('path_and_filename');
If you want to append to the file:
file_put_contents('path_and_filename' , 'content' , FILE_APPEND );
You can also lock the file:
file_put_contents('path_and_filename' , 'content' , LOCK_EX );
Take a look at the links below:
http://php.net/manual/en/function.file-put-contents.php
http://php.net/manual/en/function.file-get-contents.php