
<br />
if ( ! write_file('./path/to/file.php', $data))<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp; echo 'Unable to write the file';<br />
}<br />
else<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp; echo 'File written!';<br />
}</code>

<p>You can optionally set the write mode via the third parameter:</p>

<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 