I have an input text form but sometimes some forms are not filled with text, but I don't want to generate blank space in my echo page. How can I eliminate this lost space if my input text is not entered in the form.
<? echo $rows['info']; ?>
<? echo trim($rows['info']); ?>
You should use the php trim()
function.
use trim:
<? echo trim($rows['info']); ?>
add the <br />:
$info = trim($rows['info']);
if (!isEmpty($info)) {
echo $info . "<br />";
}