Store values from a big .txt file into an array
<p>I have a big .txt file (73 thousand lines) and i need to store the data from that file in an array.</p>

<p>Here is an example of how the file looks, it just repeats in this fashion, every line looks like this.</p>

<pre><code>2016-05-27 11:04:16: QParRFSum=1574.00 QParRFSumMean=6.05 QParSuspSum=83.00
2016-05-27 11:14:07: QParRFSum=1537.00 QParRFSumMean=5.91 QParSuspSum=96.00
2016-05-27 11:14:07: QParRFSum=1537.00 QParRFSumMean=5.91 QParSuspSum=96.00
2016-05-27 11:24:07: QParRFSum=1405.00 QParRFSumMean=5.40 QParSuspSum=0.00
2016-05-27 11:24:07: QParRFSum=1405.00 QParRFSumMean=5.40 QParSuspSum=0.00
2016-05-27 11:34:06: QParRFSum=1533.00 QParRFSumMean=5.90 QParSuspSum=89.00
2016-05-27 11:34:06: QParRFSum=1533.00 QParRFSumMean=5.90 QParSuspSum=89.00
</code></pre>

<p>And I would like to put this into an array with keys like this:</p>

<pre><code>Array (
[0] =&gt;
(
    [date] =&gt; 2016-05-27
    [time] =&gt; 11:04:16
    [QParRFSum] =&gt; 1574.00
    [QParRFSumMean] =&gt; 6.05
    [QParSuspSum] =&gt; 83.00
)
[1] =&gt;
(
    [date] =&gt; 2016-05-27
    [time] =&gt; 11:14:07
    [QParRFSum] =&gt; 1537.00
    [QParRFSumMean] =&gt; 5.91
    [QParSuspSum] =&gt; 96.00
)
[2] =&gt;
(
    [date] =&gt; 2016-05-27
    [time] =&gt; 11:14:07
    [QParRFSum] =&gt; 1537.00
    [QParRFSumMean] =&gt; 5.91
    [QParSuspSum] =&gt; 96.00
)
)
And so on...
</code></pre>

<p>How would i do this in the best way, having performance in mind?</p>

<p>My thought was to go through it line by line with the file() function and a foreach loop. And then somehow process it into the array structure I want. Something like this:</p>

<pre><code>$txt=file('path/to/file');
foreach($txt as $line)
{
   $RFAValues[] = $line;
}
</code></pre>

<p>Is this the way to go, or is there a better way which will give me better performance?</p>