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 this. My host won’t help me. This is my code:
$f = fopen($id."/adres.xml", "w");
fwrite($f, 'some content');
fclose($f);
I was wondering what alternatives there are. I’ve read many things about using cUrl, but to me that seems more like getting documents from other sites and using that, instead of creating a document (please tell me if this do is possible).
So, my question is, what are the alternatives to fopen (functions, etc).
If you want to append to the file:
You can also lock the file:
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