Created
August 23, 2017 16:57
-
-
Save bdunn313/8aa65c756314d6e0a9ba488d951d80df to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Normal php conditional | |
if (true) { | |
echo 'This normal one is true!'; | |
} else { | |
echo 'Its false'; | |
} | |
// Alternative syntax | |
if (true): | |
echo 'This alternate one is true!'; | |
else: | |
echo 'Its false'; | |
endif; | |
// Now to mix in some HTML | |
$items = ['one', 'two', 'three']; | |
?> | |
<ul> | |
<?php foreach($items as $i): ?> | |
<li><?php echo $i; ?></li> | |
<?php endforeach; ?> | |
</li> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment