私はこの問題に苦労しています.URLとステータスの名前を持つ2つの列があり、ループでこのhtmlテーブルにデータを投稿する必要があります.私が直面している問題は、列のタイトルが何度もループし続けることですが、私はそれが一度だけ欲しい...これは私のコードです
<?php
if (preg_match("/found/", $html))
{
echo '<table id="table-2">
<thead>
<tr>
<th>URL</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>'.$get_sites_link.'</td>
<td>Keyword Found</td>
</tr></tbody>
</table>';
$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 '<table id="table-2">
<thead>
<tr>
<th>URL</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr>
<td>'.$get_sites_link1.'</td>
<td>Keyword Not Found</td>
</tr></tbody>
</table>'."</b>"."</br>";
}
}
?>
どんな助けでも大歓迎です:)