my apologies if there's an answer to this on SO somewhere. I searched around with no avail.
I'm wondering if there's alternative syntax for else if with HTML inside exists. I know there's such alternative syntax for if and else, but couldn't find anything in the PHP documentation for else if.
Right now I have this code:
<?php if($err) : ?>
<div class="alert-failure"><?php echo "Error: " . $err; ?></div>
<?php endif; ?>
<?php if ($success): ?>
<div class="alert-success"><?php echo "Success: " . $success; ?></div>
<?php endif; ?>
But this seems illogical since my app won't be having an error if it's successful. Is there a way to use else if here? Thanks in advance!
<?php echo "
should be<?= "
, and without all the; ?>