3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = [ ['fine_type' => 'a:3:{i:0;s:2:"66";i:1;s:2:"13";i:2;s:1:"9";}'], ['fine_type' => 'a:3:{i:0;s:2:"99";i:1;s:2:"10";i:2;s:1:"1";}'], ]; $output = ""; $abc=''; foreach($result as $row) { $fine_types = unserialize($row['fine_type']); echo "<td>"; foreach ($fine_types as $fine_type) { $abc .="<div dir='rtl' lang='ar' class='fntype'> ".$fine_type.'</div>'; } echo "</td>"; $output .= ' <tr> <td style="text-align:right;">' . $abc . '</td></tr>'; } echo $output;
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
<td></td><td></td> <tr> <td style="text-align:right;"><div dir='rtl' lang='ar' class='fntype'> 66</div><div dir='rtl' lang='ar' class='fntype'> 13</div><div dir='rtl' lang='ar' class='fntype'> 9</div></td></tr> <tr> <td style="text-align:right;"><div dir='rtl' lang='ar' class='fntype'> 66</div><div dir='rtl' lang='ar' class='fntype'> 13</div><div dir='rtl' lang='ar' class='fntype'> 9</div><div dir='rtl' lang='ar' class='fntype'> 99</div><div dir='rtl' lang='ar' class='fntype'> 10</div><div dir='rtl' lang='ar' class='fntype'> 1</div></td></tr>

preferences:
127.8 ms | 403 KiB | 91 Q