I need to display the num of the row (tr) using php, but I don't know how to do this because I am using quotes.
$data['formation'] = '
<div class="table-responsive">
<table class="table table-bordered" style="width: auto !important;">
<thead style="font-weight: bold;">
<tr>
<td>N</td>
<td>Intitulé</td>
<td>Organisme</td>
<td>Date</td>
<td>Durée (en heures)</td>
<td>Eval. à chaud / à froid</td>
<td>Dispositif utilisé</td>
</tr>
</thead>
<tbody class="table-striped">
<tr>
<td>
**HERE NUM OF THE ROW**
</td>
<td>
<input type="text" class="form-control" name="form_intitule" id="form_intitule" readonly>
</td>
<td>
<input type="text" class="form-control" name="form_organisme" id="form_organisme" readonly>
</td>
<td>
<input type="text" class="form-control" name="form_date" id="form_date" readonly>
</td>
<td>
<input type="text" class="form-control" name="form_duree" id="form_duree" readonly>
</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>';
}
This is my code:
foreach($html->find('table') as $table){
// returns all the <tr> tag inside $table $all_trs = $table->find('tr');
$count = count($all_trs); echo $count;
}