Yes, the standard syntax in PHP works.
As suggested by the term standard I used in my last sentence, I really meant that it is the standard syntax. It always worked. It will always work.
Consider the alternative syntax alternative, that is, non-standard. The wording is from the PHP manual, not from me personally.
Alterantive already suggests that it works exactly the same, so you can use any of those, despite the votes on some Q&A platform somewhere in the world wide web :)
<?php if ($condition) { ?>
<a href="http://yahoo.com">This will only display if $condition is true</a>
<?php } ?>
By request, here's elseif and else (which you can also find in the docs: elseif; else)
<?php if ($condition) { ?>
<a href="http://yahoo.com">This will only display if $condition is true</a>
<?php } elseif($anotherCondition) { ?>
more html
<?php } else { ?>
even more html
<?php } ?>
It's that simple.
The HTML will only be displayed if the condition is satisfied.
I hope this exemplary reqplique does add enough clarity if there were any doubts.