I try to get all <tr>
from a site with cURL. Today i have this HTML code, and now i want to get every tr:
<tr>
<th colspan="7">2019/20</th>
</tr>
<tr>
<th style="width:30%;">row</th>
</tr>
<tr>
<td>colum</td>
<td>colum</td>
</tr>
<tr>
<td>colum</td>
<td>colum</td>
</tr>
<tr>
<td>colum</td>
<td>colum</td>
</tr>
<tr>
<th colspan="7">2018/19</th>
</tr>
I have try with this PHP code:
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$html = curl_exec($ch);
$tr = explode('<tr>', $html);
$tr = explode('</tr>', $tr[1]);
$tr = strip_tags($tr[0]);
echo $tr;
How can i get every <tr>
in a array?