Please Stop Echoing Things

For my little brother who likes to embedding PHP to html but not sure how to do it nicely.

You probably have ever seen or even written code like below:

foreach($results as $row) {
echo '<tr>';
echo '<td>'.$row->name.'<td>';
echo '<td>'.$row->email.'</td>';
echo '</tr>';
  1. PHP short echo tag (<?=) is now available forever (PHP version 5.4+)
  2. PHP have alternative syntax of control structure:

With those powerful feature, we can rewrite code above little bit more handsome:

<?php foreach($results as $row): ?>
<td><?= $row->name; ?></td>
<td><?= $row->email; ?></td>
<?php endforeach; ?>

See ? so what do you think ?