如果为空,则使用PHP隐藏和删除行

I am attempting to hide a field when empty,

So far I have gotten the following to somewhat do what I need

<html>
<body>
<div class="container">
<textarea id="output">
<?php if(isset($_POST['errorMessage']) && !empty($_POST['errorMessage'])){ ?>
Error message code              -    <?php echo $_POST['errorMessage']; ?>
<?php } ?>
</textarea>
</div>
</body>
</html>

Although I find this just leaves blank space where the field would have been, how can I hide the field and remove the space if the field is empty?

</div>

Found the solution to the issue I was experiencing

if(isset($_POST['documentName']) && 
!empty($_POST['documentName'])){ 
echo 'Document Name                     -    ' . 
($_POST['documentName']) . '
'; 
}