summaryrefslogtreecommitdiffstats
path: root/user_guide/helpers/file_helper.html
diff options
context:
space:
mode:
Diffstat (limited to 'user_guide/helpers/file_helper.html')
-rw-r--r--user_guide/helpers/file_helper.html6
1 files changed, 6 insertions, 0 deletions
diff --git a/user_guide/helpers/file_helper.html b/user_guide/helpers/file_helper.html
index c6b049b27..6970dd586 100644
--- a/user_guide/helpers/file_helper.html
+++ b/user_guide/helpers/file_helper.html
@@ -103,6 +103,12 @@ else<br />
&nbsp;&nbsp;&nbsp;&nbsp; echo 'File written!';<br />
}</code>
+<p>You can optionally set the write mode via the third parameter:
+
+<code>write_file('./path/to/file.php', $data, <var>'r+'</var>);</code>
+
+<p>The default mode is <kbd>wb</kbd>. Please see the <a href="http://php.net/fopen">PHP user guide</a> for mode options.</p>
+
<p>Note: In order for this function to write data to a file its file permissions must be set such that it is writable (666, 777, etc.).
If the file does not already exist, the directory containing it must be writable.</p>