title: Displaying html text in loop only once php
body: <p>I am having difficulty in this matter, i have like 2 columns with name of URL and Status and i have to post data into this html table in a loop, the problem that i am facing is the column title keeps looping itself again and again but i want it only once...this is my code</p>
  
  <pre><code>    &lt;?php
      if (preg_match("/found/", $html))
          {
  
      echo '&lt;table id="table-2"&gt;
  &lt;thead&gt;
  &lt;tr&gt;
  &lt;th&gt;URL&lt;/th&gt;
  &lt;th&gt;Status&lt;/th&gt;
  &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
  &lt;tr&gt;
  &lt;td&gt;'.$get_sites_link.'&lt;/td&gt;
  &lt;td&gt;Keyword Found&lt;/td&gt;
  
  &lt;/tr&gt;&lt;/tbody&gt;
  &lt;/table&gt;';
      $vul_url[] = $get_sites_link1; 
      $links_duplicate_removed = array_unique($vul_url);
      file_put_contents($save_file, implode(PHP_EOL, $links_duplicate_removed));
      }
      else 
      {
      echo '&lt;table id="table-2"&gt;
  &lt;thead&gt;
  &lt;tr&gt;
  &lt;th&gt;URL&lt;/th&gt;
  &lt;th&gt;Status&lt;/th&gt;
  &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
  &lt;tr&gt;
  &lt;td&gt;'.$get_sites_link1.'&lt;/td&gt;
  &lt;td&gt;Keyword Not Found&lt;/td&gt;
  
  &lt;/tr&gt;&lt;/tbody&gt;
  &lt;/table&gt;'."&lt;/b&gt;"."&lt;/br&gt;";
  
      }
      }
  
      ?&gt;
  </code></pre>
  
  <p>Any help will be appreciated :)</p>