In summary, I created a table with type text in sql so that the user could save some content. But by pulling it back into the HTML formatting is lost.
To heal this I thought about using the < pre > tag, but the < pre > it fills up my bug layout as too big a drawback only in the first paragraph, and does not break the line if the text is too large, it expands the width of the page. Do you have any way to keep this text formatting?
Ps. the code in question should return several records, so can not predict where the line break will appear. The image below was just a random record for testing
Hereisthebackendcodeused:
entry:
$query=$conect->query('INSERTINTOtextos(texto)VALUES({$_POST['texto']}')');
output:
$query=$conect->query("SELECT * FROM textos");
no html / php:
while ($temp = $query->fetch_assoc() ) { ?>
<div><pre>
<?PHP echo $temp['texto']; ?>
</pre></div>
<?php} ?>