title: for each .txt file line create a new link with .txt file line data in php
body: <p>I would like to create a .php file that will read a .txt file and then for each line in the text file it will take the data and create a new link with the data.</p>
  
  <p><em>Example:</em></p>
  
  <p><strong>list.txt</strong></p>
  
  <pre><code>r2389
  y3323
  u3330
  d2723
  </code></pre>
  
  <p><strong>reader.php</strong></p>
  
  <pre><code>&lt;?php
      $myFile = "list.txt";
      $lines = file($myFile);
  ?&gt;
  &lt;a href="http://website.com/&lt;?php echo $lines[0];?&gt;"&gt;link 1&lt;/a&gt;
  &lt;a href="http://website.com/&lt;?php echo $lines[1];?&gt;"&gt;link 2&lt;/a&gt;
  &lt;a href="http://website.com/&lt;?php echo $lines[2];?&gt;"&gt;link 3&lt;/a&gt;
  &lt;a href="http://website.com/&lt;?php echo $lines[3];?&gt;"&gt;link 4&lt;/a&gt;
  </code></pre>
  
  <p><strong>reader.php</strong> output</p>
  
  <pre><code>&lt;a href="http://website.com/r2389"&gt;link 1&lt;/a&gt;
  &lt;a href="http://website.com/y3323"&gt;link 2&lt;/a&gt;
  &lt;a href="http://website.com/u3330"&gt;link 3&lt;/a&gt;
  &lt;a href="http://website.com/d2723"&gt;link 4&lt;/a&gt;
  </code></pre>
  
  <p><br><br></p>
  
  <p>This will get the information and then echo it into the link.<br>
  But this means I need to create the right amount of links for it to work properly, in the end I want to just be able to edit the <strong>list.txt</strong> and then have the php automatically create a</p>
  
  <pre><code>&lt;a href="&lt;?php echo $lines[*];?&gt;"&gt;link *&lt;/a&gt;
  </code></pre>
  
  <p>depending on the amount of lines in the <strong>list.txt</strong>.
  It will also label</p>
  
  <pre><code>&lt;a&gt;link *&lt;/a&gt;
  </code></pre>
  
  <p>depending on the line number.</p>
  
  <p>Thanks in advance.</p>