title: read from an uploaded file
body: <p>I'm using this code to upload a text file</p>
  
  <pre><code>&lt;?php
  
  if(isset($_POST['submit'])){
  $name = $_FILES["file"]["name"];
  
  $tmp_name = $_FILES['file']['tmp_name'];
  $error = $_FILES['file']['error'];
  
  if (isset ($name)) {
      if (!empty($name)) {
  
      $location = 'C:/inetpub/wwwroot/';
  
      if  (move_uploaded_file($tmp_name, $location.$name)){
          echo 'File Uploaded';    
          }
  
          } else {
            echo 'please choose a file';
            }
      }
  }
  ?&gt;
  
  &lt;form action="" method="POST" enctype="multipart/form-data"&gt;
      &lt;input type="file" name="file"&gt;&lt;br&gt;&lt;br&gt;
      &lt;input type="submit" name="submit" value="Submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>then I have this code to read the content of a file line by line</p>
  
  <pre><code>&lt;?php
  
      $lines = file ('the_name_of_file.txt');
      foreach ($lines as $name){
          echo "$name &lt;br&gt;";
  
      }
  
  ?&gt;
  </code></pre>
  
  <p>how can I use the second code to read from an uploaded file?</p>