title: Notice when filtering through array in PHP
body: <p>I'm creating a script that will filter out duplicate lines from a textarea. However, I am constantly getting various "Notice: Undefined offset: 2" &amp; other higher offsets after the script has filtered through it. I'm uncertain on how to stop the messages from appearing in the results. This is what I have so far.</p>
  
  <pre><code>&lt;?php
  $textarea = $_POST['textarea'];
  $split    = explode("\r", $textarea);
  $split    = array_unique($split);
  $i = 0;
  if (isset($_POST['submit1'])) { 
            $submit = $_POST['submit1'];
            for ($i; $i &lt; count($split); $i++) {
             echo $split[$i];
  }
  }
  ?&gt;
  </code></pre>