<!--var1-->
<?php if ($box->mobile_number != Null) {echo '
<div class="col-sm-6 col-md-3 mb-4 mb-md-0">
<div class="border rounded p-3 text-center"> <span class="d-block text-10 text-light mt-2 mb-3"><i class="fas fa-mobile-alt"></i></span> <span class="text-5 d-block text-success mt-4 mb-3"><i class="fas fa-check-circle"></i></span>
<p class="mb-0">Mobile Added</p></div>
</div>';
} else {echo'
<div class="col-sm-6 col-md-3 mb-4 mb-md-0">
<div class="border rounded p-3 text-center"> <span class="d-block text-10 text-light mt-2 mb-3"><i class="fas fa-mobile-alt"></i></span> <span class="text-5 d-block text-light mt-4 mb-3"><i class="far fa-circle"></i></span>
<p class="mb-0"><a class="btn-link stretched-link" href="">Add Mobile</a></p></div>
</div>';}?>
<!--var2-->
<?php if ($box->email_address != Null) {echo '
<div class="col-sm-6 col-md-3 mb-4 mb-md-0">
<div class="border rounded p-3 text-center"> <span class="d-block text-10 text-light mt-2 mb-3"><i class="fas fa-envelope"></i></span><span class="text-5 d-block text-success mt-4 mb-3"><i class="fas fa-check-circle"></i></span>
<p class="mb-0">Email Added</p></div>
</div>';
嗨,我不能将它们嵌套在 IF (all_these_4_statements != Null) { echo '';} else { echo 'above_codes';} 因为 ' 和 " 都被使用了。
目前所有这 4 条语句都封装在 div 标签中
如何解决这个问题?谢谢。
慕森卡
胡子哥哥