<span class="p">}</span>
<span class="k">else</span>
<span class="p">{</span>
        <span class="k">echo</span> <span class="s1">&#39;File written!&#39;</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</div>
<p>You can optionally set the write mode via the third parameter:</p>
<div class="highlight-ci"><div class="highlight"><pre><span class="nx">write_file</span><span class="p">(</span><span class="s1">&#39;./path/to/file.php&#39;</span><span class="p">,</span> <span class="nv">$data