title: PHP - How to explode() lines from text file in to an array?
body: <p>This is what I'm trying to do: </p>
  
  <ul>
  <li>I have a text file called <strong>member.log</strong> </li>
  <li><p>ADD THE TOTAL amount of outstanding payments from each member-210.00 etc,
  Eg: <strong>inactive : [2007-04-01 08:42:21] "home/club/member" 210.00 "r-200"</strong></p></li>
  <li><p>To me it makes seems that I would need to separate the different parts of record so that I can target the [key] that correspondes to the amount 210.00, etc</p></li>
  <li><p>I thought to do this with explode() but as I'm not passing a string to explode() I am getting an error: <strong><em>Warning: explode() expects parameter 2 to be string, array given in /home/mauri210/public_html/lfctribe.com/index.php on line 25</em></strong></p></li>
  </ul>
  
  <p>How can I solve this so that I can add up the total for each line? </p>
  
  <p>Here is my php: </p>
  
  <pre><code>&lt;?php
  //Open the dir 
  $dirhandle = opendir('/home/mauri210/public_html/lfctribe.com/data');
  
  //Open file 
  $file = fopen('/home/mauri210/public_html/lfctribe.com/data/members.log', 'r');
  
  //Declare array 
  $arrFile = array();
  
  //Add each line of file in to array while not EOF 
  while (!feof($file)) {
      $arrFile[] = fgets($file);
  
      //explode 
      $exarrFile = explode(' ', $arrFile);
  }
  
  var_dump($exarrFile);
  ?&gt;
  </code></pre>
  
  <p><strong>Here is contents of members.log :</strong></p>
  
  <pre><code>inactive : [2007-04-01 08:42:21] "home/club/member" 210.00 "r-200"
  inactive : [2008-08-01 05:02:20] "home/club/staff" 25.00 "r-200"
  active : [2010-08-11 10:12:20] "home/club/member" 210.00 "r-500"
  inactive : [2010-01-02 11:12:33] "home/premier/member" 250.00 "r-200"
  active : [2013-03-04 10:02:30] "home/premier/member" 250.00 "r-800"
  active : [2011-09-14 15:02:55] "home/premier/member" 250.00 "r-100"
  </code></pre>