Out of curiosity, I just want to ask about good coding practice. The code below has the same outputs, but has a difference encoding.
So which is better?
This:
<?php foreach ($cart as $item): ?> <tr> <td><?php echo $item['name']; ?></td> <td><?php echo $item['checkin']; ?></td> <td><?php echo $item['checkout']; ?></td> </tr> <?php endforeach; ?>
Or this one:
<?php foreach ($cart as $item): echo "<tr>"; echo "<td>$item['name']</td>"; echo "<td>$item['checkin']</td>"; echo "<td>$item['checkout']</td>"; echo "</tr>"; endforeach; ?>
source share