How do i solve this "Notice: Undefined offset: on line 14"?
<p>I was wondering if anyone could give me a little help I have a php script and its giving me this error:</p>

<p>Notice: Undefined offset: 8 in xxxx/xxxx/xx.php on line 14</p>

<p>here is the code I have:</p>

<pre><code>     &lt;?php  

    // Opens the file "april" in read mode only
    $fileLog = fopen("april.txt", "r");

    // Variable to count the total bytes used during the month
    $totalBytes = 0;

    // While not the end of file get and echo the data line by line
    while (!feof($fileLog)) {
    $line = fgets($fileLog, 1024);


    // Explodes the data with a space   
    $details = explode(' ', $line);

    // Adds all the bytes and stores them in $totalBytes
    $totalBytes = $totalBytes +(int)$details[8]; // line 14
    }
    echo "&lt;h3&gt;April Statistics&lt;/h3&gt;";

    // echoes the total bytes
    echo "&lt;p&gt;The TOTAL bandwidth consumed used: 8.43MB ($totalBytes Bytes)&lt;/p&gt;";
    fclose($fileLog);

    ?&gt;
</code></pre>

<p>Can anyone tell me how do I solve this or give me an example.
Any help will be deeply appreciated thank you. </p>

<p>ok here is an example of the file's contents:</p>

<p>103.239.234.105 -- [2007-04-01 00:42:21] "GET articles/learn_PHP_basics HTTP/1.0" 200 12729 "Mozilla/4.0"</p>

<p>207.3.35.52 -- [2007-04-01 01:24:42] "GET index.php HTTP/1.0" 200 11411 "Mozilla/4.0"</p>

<p>and im adding the total bandwidth consumed by the file requested over the month.</p>
