I'm having trouble writing to a file even though is_writable()
returns true. Of course, the file exists and is apparently readable. Here is the code:
$file = "data";
echo file_get_contents($file)."<br>";
echo is_writable($file) ? "is writable<br>" : "not writable<br>";
if (file_put_contents($file, "ghijkl", FILE_APPEND) === FALSE) echo "failed<br>";
echo file_get_contents($file)."<br>";
And here is the output:
abcdef
is writable
failed
abcdef