title: How to get td data from a table in PHP
body: <p>I am currently stuck at this problem right now where I don't seem to have any idea how to implement this. I have this table which is populated from a csv file in php and I want to get the data logged in order to calculate the daylight hours. </p>
  
  <p><strong>How can I get the data from the td "dateLogged", I did that in jquery before using children but I do not seem to be able to do that in php</strong></p>
  
  <pre><code>//print out uploaded file.csv
              echo "&lt;html&gt;&lt;body&gt;&lt;table BORDER=1&gt;\n\n";
              echo "  &lt;tr&gt;&lt;th&gt;AvgCrown&lt;/th&gt;&lt;th&gt;MinCrown&lt;/th&gt;&lt;th&gt;MaxCrown&lt;/th&gt;&lt;th&gt;dateLogged&lt;/th&gt;&lt;th&gt;DaylightHours&lt;/th&gt;&lt;/tr&gt;";
              $f = fopen("./uploads/" . $_FILES["uploadedfile"]["name"], "r");
  
          while (($line = fgetcsv($f)) !== false) {
                  echo "&lt;tr&gt;";
                  foreach ($line as $cell) {
                          echo "&lt;td&gt;" . htmlspecialchars($cell) . "&lt;/td&gt;";
                  }
                  echo "&lt;td&gt;" . calcDaylight() . "&lt;/td&gt;";
  
                  echo "&lt;tr&gt;\n"; 
  
  
          }
          fclose($f);
          echo "\n&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;";
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/dytaj.jpg" alt="Here is a sample how the table looks like"></p>
  
  <p>Here is a sample how the table looks like
  Any help will be most welcome.</p>