Check if line affected when writing a file with php
<p>how can i check if a line was written to a file?
I am trying something like this:</p>

<pre><code>    if (fwrite($handle, $data) == FALSE) {
    echo "&lt;script&gt;
            alert('Not written');
        &lt;/script&gt;";
    include ('index.html');
    }
    else{
    echo "&lt;script&gt;
            alert('Written');
        &lt;/script&gt;";
            include ('index2.html');}
    fclose($handle);
</code></pre>

<p>but it still notifies me as written even if nothing was put in the file.</p>
