When i am trying to execute file_put_contents function to change the content of a text file, it is showing me following error :
Warning: file_put_contents(somefile.txt) [function.file-put-contents]: failed to open stream: Permission denied in path/to/changecontent.php
Is there any way to check whether we have permission to change a file contents or not?
You can use
is_writableto check if a file or directory is writable.