title: Explode array results and echo.
body: <p>Have been working on a small project, and have gotten stuck at a part that I am trying to get working. Not sure if I am taking the wrong type of approach for it, and there is a better way, but here we go. </p>
  
  <p>I have data in a text file that is written and read to.
  example: (values are separated by a \t) </p>
  
  <pre><code>S1684    This is a status    share   20/9/2012           share;
  </code></pre>
  
  <p>What I am doing is searching the file, and returning anything that matches as a part of the array. I have the search working fine, and can return each line that contains the search query, only problem is exploding the results so that I can properly format what I return. This is the main chunk that deals with it.</p>
  
  <pre><code>if(preg_match_all($pattern, $data, $matches)){
         echo "&lt;h3&gt;Results:&lt;/h3&gt;";
  
         echo implode("&lt;p&gt;\r\n", $matches[0])."&lt;/p&gt;";
  
         foreach ($matches as &amp;$value) {
          $date =0;
           list($statusCode, $status, $share, $date, $like, $comment, $share) = explode("\t", $date);
  
           echo "&lt;h4&gt;Status:".$status."&lt;/h4&gt;";
           echo "&lt;h4&gt;Status Code:".$statusCode."&lt;/h4&gt;";
         }
  
      }
  </code></pre>
  
  <p>The error I receive are undefined offset errors, so how exactly would I be able to explode (or split the array result in any other way) to echo it properly?</p>
  
  <p>Any help is much appreciated thanks.</p>