/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
if: <?php if ($foo == 'yes') { ?> do something <?php } if ($bar == 'no') { ?> do something else <?php } ?> else/if: <?php if ($foo == 'surething') { ?> do this <?php } else { ?> do everything else <?php } ?> else/if variation: <a class="<?php if ($foo == 'righto') { ?> selected <?php } else { ?> hoverBtn <?php } ?>" href="contact.php"><span>Contact</span></a>