What potential pitfalls should be considered when outputting multi-line text in PHP within a table?
When outputting multi-line text in PHP within a table, one potential pitfall to consider is that HTML does not interpret line breaks or new lines within text by default. To ensure that multi-line text is displayed correctly within a table cell, you can use the nl2br() function in PHP to convert new lines to HTML line breaks <br>. This will preserve the line breaks in the text and display it properly within the table cell.
<?php
$text = "This is a multi-line
text example.";
?>
<table>
<tr>
<td><?php echo nl2br($text); ?></td>
</tr>
</table>