I want to add a condition with PHP within the $output. For the item in , I know that I can simply replace the PHP tag with '. But for the IF clause, I am not sure how to correct it as the PHP code doesn't work in the variable. Thanks!
$output .='<div class="square-card">
<?php if($row['Tutor_subject_2'] != ''){ ?>
<span class="subject"><?= $row['Tutor_subject_2']; ?></span>
<? }?>
</div>';