PHP tests and conditionnal : I try with this code to display an event date who have a begin and ending date but sometimes there is only one begin date.

If there is begin and ending date i need this display:
 **DU 10 JUILLET 2017 AU 10 JUILLET 2017**

And if there is only begin date, i need this display:
 **LE 10 JUILLET 2017** the "DU" is replace by "LE"

    <?php if (isset($this->item->jcfields[3]) && !empty($this->item-jcfields[3])): 
    ?>Du
	<?php echo FieldsHelper::render('com_content.article', 'field.render', 
    array('field'=> $this->item->jcfields[3])); ?>
			<?php endif; ?>
			<?php if (isset($this->item->jcfields[7]) && !trim($this->item-
    >jcfields[7])): ?>Au
	<?php echo FieldsHelper::render('com_content.article', 'field.render', 
    array('field'=> $this->item->jcfields[7])); ?>
			<?php endif; ?>