title: php - map table row with a href link dynamically
body: <p>I have an array which i use to dynamically create a table.
  I have a name=value pair (Server=server.alias) which values are being extracted and would like to make it <strong>hyperlinked</strong> to another webpage.</p>
  
  <p>What I need help is figuring out the code to map the alias name with a specific href link which I think I will have to hard code. The href link is <strong>different</strong> for each alias, so there is no pattern there. </p>
  
  <p>Would an if statement be appropriate for this? Any other suggestions to do this? Thank you.</p>
  
  <p>Expected Output:</p>
  
  <pre><code>Server  
  ----------------
  server1.alias  &lt;-- hreflink = http://server1.name.com:/9999
  server2.alias  &lt;-- hreflink = http://server2.name.colo.com:/2999
  </code></pre>
  
  <p>My code so far generating the dynamic rows look like this:</p>
  
  <pre><code>$keys = array('Server');                                                              
  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;/table&gt;';
  </code></pre>