title: How do I read each line from a file in php?
body: <p>I'm new to learning php and in one of my first programs I wanted to make a basic php website with login capabilities with and array of the user and passwd. </p>
  
  <p>my idea is to store the username as a list parameter and have the passwd as the contents, like this:</p>
  
  <pre><code>arr = array(username =&gt; passwd, user =&gt; passwd);
  </code></pre>
  
  <p>now my problem is that I don't know how I can read from the file (<code>data.txt</code>) so I can add it into the array. <br></p>
  
  <pre><code>data.txt sample:
  username passwd
  anotherUSer passwd
  </code></pre>
  
  <p>I've opened the file with <code>fopen</code> and stored it in <code>$data</code>. </p>