title: Read .txt file and output/echo selected information using PHP
body: <p>I have a file called priv.txt. In it reads:</p>
  
  <pre><code>9992,"D7Mc8DJUsN4xisbVRKDfNVYxspVXQ776EG","6JQ5cdFBBax7GBmBuK8j2vvBcNUAYJjvzBQzMMfen26SwpCsNxh"
  9993,"DEbh8BmvCHqJgX6YFMjbqgewHHQKo4PJWT","6JTwvRVVTTit1PZRpKQDSCeFPG2knWmDAN7uRgeY2o58pUD8sRf"
  9994,"DMJ5LhU7XBtZvmNHswthR5tnFR71FFDxFn","6JMr4n8xK3NCdjyMBrqPWCvPpbifjr6ofPi1jha79FYzPSgBTWf"
  </code></pre>
  
  <p>etc...</p>
  
  <p>What I need to do, is output (via echo for example) in this format:</p>
  
  <pre><code>'{"D7Mc8DJUsN4xisbVRKDfNVYxspVXQ776EG":2,"DEbh8BmvCHqJgX6YFMjbqgewHHQKo4PJWT":2,"DMJ5LhU7XBtZvmNHswthR5tnFR71FFDxFn":2}'
  </code></pre>
  
  <p>The 2 should always stay the same and this only concerns the first column, the second column with strings beginning with "6" is irrelevant. </p>
  
  <p>I have a php file which does:</p>
  
  <pre><code>&lt;?php
  $fh = fopen('priv.txt','r');
  while ($line = fgets($fh)) {
  // &lt;... Do your work with the file ...&gt;
  echo($line);
  }
  fclose($fh);
  ?&gt;
  </code></pre>
  
  <p>This just outputs the entire content of priv.txt.</p>
  
  <p>Can anyone help?</p>