php help - creating default value for specific column on html table
<p>I need some help tweaking this php code to print out a default value for a specific column. </p>

<p>I'm printing out the following column header columns in a table:
<code>Host Target Date Set Time Length Size Status</code></p>

<p>There are instances in the 'tst.txt' input file where I don't have data for the last (3) columns <code>Length Size Status</code></p>

<p>I originally was creating a blank cells for this data, but now I want to put a DEFAULT data for only the column: <code>Status</code> 
where if status is null then print <code>CHECK FOR ERRORS</code> as an example.</p>

<p>I tried coding that below, but its doing it for every blank cell, but I just want it for column status. Thanks!</p>

<pre><code>&lt;?php
$data = array();
$InputFile = file("tst.txt");

foreach ($InputFile as $line){
  preg_match_all("/([0-9])-([^=]+)=([^;]+);/", $line, $matches, PREG_SET_ORDER);
  $LineData = array();
  foreach ($matches as $information)
  {
    $LineData[$information[2]] = $information[3];
  }
  $timestamp = strtotime($LineData["Date"]." ".$LineData["Time"]);
  $data[$timestamp] = $LineData;
}
ksort($data);

$keys = array('Host', 'Target','Date','Set','Time', 'Length','Size','Status');
echo '&lt;table&gt;&lt;tr&gt;';
foreach ($keys as $column)
   echo '&lt;th&gt;' . $column . '&lt;/th&gt;';
    echo '&lt;/tr&gt;';

foreach ($data as $row){
   echo '&lt;tr&gt;';
     foreach ($keys as $column)
        if (isset($row[$column])){
          echo '&lt;td&gt;' . $row[$column];
          } else {
          //echo '&lt;td&gt;' . '' . '&lt;/td&gt;';
          echo '&lt;td&gt;' . 'Check for Errors' . '&lt;/td&gt;';
        }
}
echo '&lt;/table&gt;';
//print_r($data);
?&gt;
</code></pre>
